From minios-devel-bounces@lists.xenproject.org Mon Jul 08 07:20:23 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 07:20:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755040.1163335 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQiff-0001ql-1h; Mon, 08 Jul 2024 07:20:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755040.1163335; Mon, 08 Jul 2024 07: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sQife-0001qV-Tn; Mon, 08 Jul 2024 07:20:22 +0000
Received: by outflank-mailman (input) for mailman id 755040;
 Mon, 08 Jul 2024 07:02:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iX0w=OI=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sQiO8-0006O8-M5
 for minios-devel@lists.xenproject.org; Mon, 08 Jul 2024 07:02:16 +0000
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com
 [2607:f8b0:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fec86bac-3cf7-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 09:02:12 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-1faad2f1967so30712235ad.0
 for <minios-devel@lists.xenproject.org>; Mon, 08 Jul 2024 00:02:13 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fec86bac-3cf7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720422131; x=1721026931; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=GlmUL91vpGYV8kIApe/neR3dKN+D50bYXKKcwSeCD2w=;
        b=bw9RHX+qgUUYto2rMNHi9tyowD7hk5kC42uOz3Cy6PawVCE1KmQMNT6/TOCoYMdwci
         AmH2TAwMkvp115hU/STCQAkHD7w7zysHzQq8Sn4HUAdeK9UxtGN1kLaA05nVjLzQfnSP
         mVDSF7//rkosIkUIAIdcL1++ewZ+fi3XAyxjI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720422131; x=1721026931;
        h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=GlmUL91vpGYV8kIApe/neR3dKN+D50bYXKKcwSeCD2w=;
        b=YoAIaF8x204iR4GrmfPOfuxsF6ciFWSG6qwIbAefgvGB11pTPtBTz/3TFb4f8o9xCy
         K1zdNwtYthxCCUtnOiwM00NbKPxV7whSxYp8emGvq97AMRNWrozzHWAENA8NrimsIkJz
         Dk79o6pSeuwC+NNLDTAOrp5XWcs4ofLA47z2f8P7JeEszv0F1EfT/AkCxFc+M+47HwUd
         1umpmN1QOCXS/6TJFtsKf9U8yYHVbDEMxAzLhEvC9ha9zT4594aPgotCJxw3OrlbBfF9
         7xtQH6X3Y2pbNBPYJoqC0yqo600U9zTH348A9KOloSSwvCOh4YeS4Wm5REf2bxVcqzC3
         PN4w==
X-Forwarded-Encrypted: i=1; AJvYcCUvRfZGpHd1OBTdM06iHVYrrHR/wggnzmChB7CdnY9JzRPxfTi8ow2y4bw+FW+T5p6mZApYf2q39vOU14kF63XdsLQXsc7pfHY1b+t2XSm6Qc4=
X-Gm-Message-State: AOJu0Yxb6hwF0kUfEus6wa4wT82JFJJTQO/K4ywoYDoueAPenzUfP4cS
	AwS4CxObfbzZeMHCeputOQ8rZq/ulfBcroVcJLKSpffhgkPNxOBnFxILZyY2Ne67h+9o/lASie6
	JgXq/YvK0FgxLXc2hdzcP4RDzMpGMkHuum1sFHw==
X-Google-Smtp-Source: AGHT+IG4oLgN0uuHrW6brQ5w/Svh+9g8TVl946X53n95/diA8Hc0wX8bpFGUqmG2FMzI6c4QmLT6vO8PyljN4ZPNeWg=
X-Received: by 2002:a17:90a:c381:b0:2c9:75a7:5c25 with SMTP id
 98e67ed59e1d1-2c99f3ac56cmr16051365a91.15.1720422131432; Mon, 08 Jul 2024
 00:02:11 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Mon, 8 Jul 2024 08:00:00 +0100
Message-ID: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Subject: [Vote] Xen Project Code of Conduct Team Member
To: xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, win-pv-devel@lists.xenproject.org
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="000000000000021b64061cb6fe20"

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

Hi all,

As you are aware, George Dunlap has recently stepped down from the Xen
Project as a committer, but he was also a part of the Code of Conduct team.

As a result, Stefano will be the only member remaining on the CoC team. @Ro=
ger
Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
there are at least two members.

In accordance with https://xenproject.org/developers/governance/, I need
the leadership teams of the three mature projects: the Hypervisor, the XAPI
project, and the Windows PV Driver project to vote on this proposal.

The specific voting rules, in this case, are outlined in the section:
https://www.xenproject.org/governance.html#project-decisions

I propose to tally the votes after July 31st, 2024. You can reply via email
in public or private:
+1: for proposal
-1: against proposal

Based upon previous communication and rules for voting:
The vote needs to achieve a 2/3 majority to pass.

Sub-project needs to achieve the following quorum of votes in favour for
the sub-project=E2=80=99s vote to count:
Hypervisor: 3 + votes
XAPI: 2 + votes
Windows PV Drivers: 1 + votes

Many thanks,
Kelly Choi

Community Manager
Xen Project

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

<div dir=3D"ltr">Hi all,=C2=A0<div><br></div><div>As you are aware, George =
Dunlap has recently stepped down from the Xen Project as a committer, but h=
e was also a part of the Code of Conduct team.</div><div><br></div><div>As =
a result, Stefano will be the only member remaining on the CoC team.=C2=A0<=
a class=3D"gmail_plusreply" id=3D"m_-6110525638451986579m_52176897574306858=
12m_2021811972426709313plusReplyChip-0" href=3D"mailto:roger.pau@cloud.com"=
 target=3D"_blank">@Roger Pau Monne</a>=C2=A0has volunteered to join the te=
am, so that there are at least two members.</div><div><br></div>In accordan=
ce with <a href=3D"https://xenproject.org/developers/governance/" target=3D=
"_blank">https://xenproject.org/developers/governance/</a>, I need the lead=
ership teams of the three mature projects: the Hypervisor, the XAPI project=
, and the Windows PV Driver project to vote on this proposal.<br><br>The sp=
ecific voting rules, in this case, are outlined in the section: <a href=3D"=
https://www.xenproject.org/governance.html#project-decisions" target=3D"_bl=
ank">https://www.xenproject.org/governance.html#project-decisions</a><div><=
br></div><div>I propose to tally the votes after July 31st, 2024. You can r=
eply via email in public or private:<br>+1: for proposal<br>-1: against pro=
posal</div><div><br></div><div>Based upon previous communication and rules =
for voting:</div><div>The vote needs to achieve a 2/3 majority to pass.<br>=
</div><div><br>Sub-project needs to achieve the following quorum of votes i=
n favour for the sub-project=E2=80=99s vote to count:<br>Hypervisor: 3 + vo=
tes<br>XAPI: 2 + votes<br>Windows PV Drivers: 1 + votes</div><div><br></div=
><div><div>Many thanks,<br></div><div><div dir=3D"ltr" class=3D"gmail_signa=
ture" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Kelly Choi</=
div><div><br></div><div><div style=3D"color:rgb(136,136,136)">Community Man=
ager</div><div style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<br></div>=
</div></div></div></div></div></div>

--000000000000021b64061cb6fe20--


From minios-devel-bounces@lists.xenproject.org Mon Jul 08 07:20:24 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 07:20:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.549593 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQife-0001qR-Vi; Mon, 08 Jul 2024 07:20:22 +0000
Received: by outflank-mailman (output) from mailman id 549593 (unknown outflank id, message too old?); Mon, 08 Jul 2024 07:20:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQife-0001qK-SQ; Mon, 08 Jul 2024 07:20:22 +0000
Received: by outflank-mailman (input) for mailman id 549593;
 Thu, 15 Jun 2023 13:02:28 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=H8WV=CD=unikraft.io=razvand@srs-se1.protection.inumbo.net>)
 id 1q9mcO-0005QS-3j
 for minios-devel@lists.xenproject.org; Thu, 15 Jun 2023 13:02:28 +0000
X-Inumbo-ID: dede3360-0b7c-11ee-8611-37d641c3527e
Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com
 [2a00:1450:4864:20::42a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dede3360-0b7c-11ee-8611-37d641c3527e;
 Thu, 15 Jun 2023 15:02:25 +0200 (CEST)
Received: by mail-wr1-x42a.google.com with SMTP id
 ffacd0b85a97d-30aea656e36so5809012f8f.1
 for <minios-devel@lists.xenproject.org>; Thu, 15 Jun 2023 06:02:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=unikraft.io; s=google; t=1686834143; x=1689426143;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :subject:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=OMb3+pwkLciy4LZqrdWtgRtSUAuuximQVxvLHr9N0Go=;
 b=G6sPJfVhicb/hSGJ30YSapQ78+QXisokOsGAPNN7gKJ7Dh76YaPN0127meFHZM6TdE
 Ex/O0G/hnCqmCpTYDJtSV95/uLnvA3/kEmRkQ5rW76xw1o5cuZttIrspMu1CptMzJPIQ
 nR+VK2Y1/QtnSjpEazDAP8fhXNYcueDe0aE55on3ljbx2PIc2AAkUXEcSuWus1+OGgML
 /wATo5LIh5kt9UfojrresjNTlEEXsvie5NwWADRgM6koaMkudIW/cI/mJfh5gvXhqYyh
 eqv1XpSRCh0doa9TuJhCRwnPFXlMhqUgoM+gsVySIpMS0LthnADfjyQP/vbDc+CFlHDS
 5CUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1686834143; x=1689426143;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :subject:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=OMb3+pwkLciy4LZqrdWtgRtSUAuuximQVxvLHr9N0Go=;
 b=NBGvt8nMMXlTr/GH19v7hT/apIm4oXmGWkl+hQG+AqEynnUt35J08XodkiAs0nKGpi
 WwexKZNZpVz34d5i75LDpQI8kz73u6B04USpAPm5Knm647lFPxOamf7whn4UXPTklUzq
 16xPE5EidP7U75TqJTFC6PevE4IMdAadx4rxg8biOkTFjtuXgLRbogtz2DZpEs5AO27x
 j+vcqiAV+E8tu07XRX8GIS+QplhCao6qV9TyyvWMVgWqwGUrfw/gmnVIhPE7Tp0pcCVY
 8nnjupZgajMzBHimVYdwUgoRbwW12rDmz2pHF6cSCYVkMtSZVYfDtg0EUJIIMVQ/mfg1
 W4sw==
X-Gm-Message-State: AC+VfDws78NEM1xJDEYLSRBgd9myJbeMitfCX4mk0+cfwUC7mzdAFvck
 LiT8rVKeY7flldylDo6Z8ynMPIGwgoldO0tVg7k=
X-Google-Smtp-Source: ACHHUZ4u3LfBY19HJ2Pt6bCQcg7KitDuHdTSC+qgKlEVx5aefmwtBNvYjuV251sTTO5xsfYYSZ5sRg==
X-Received: by 2002:adf:f244:0:b0:30f:bfc5:2f0f with SMTP id
 b4-20020adff244000000b0030fbfc52f0fmr9371144wrp.53.1686834143163; 
 Thu, 15 Jun 2023 06:02:23 -0700 (PDT)
Received: from localhost ([141.85.225.206]) by smtp.gmail.com with ESMTPSA id
 p13-20020a5d4e0d000000b002fb60c7995esm20970244wrt.8.2023.06.15.06.02.21
 for <minios-devel@lists.xenproject.org>
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 15 Jun 2023 06:02:22 -0700 (PDT)
From: Razvan Deaconescu <razvand@unikraft.io>
To: minios-devel@lists.xenproject.org
Subject: Come to lovely Romania for the Unikraft community gathering: October
 5-8, 2023
Date: Thu, 15 Jun 2023 16:02:19 +0300
Message-ID: <86h6r8khes.fsf@drone.cs.pub.ro>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailman-Approved-At: Mon, 08 Jul 2024 07:20:22 +0000
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>

Hi, everyone.

In the Unikraft community we are organizing an yearly gathering in
lovely Romania. This year, it will be a 3 nights meeting taking place on
October 5-8, 2023. We will go to the mountains (Bu=C8=99teni) for 3 nights:
one day we will do a hackathon, one day we will be part of social
activities.

We will stay at Yael Luxury Apartments 2[1], a lovely place near the mounta=
ins.

You are welcome to join, to get in touch with the Unikraft community and
know more about unikernels and Unikaft.

Romania is a beautiful place, welcoming and safe. You can enjoy the
Bucharest[2], the capital city, with affordable accommodation, travel
and great food and places. Traveling to Bucharest is easy via plane. And
then affordable subway, tram, buses, taxi, Uber / Bold inside the city.

And you're going to have a great time in the Bucegi mountains[3], where
we can do hikes, travel to local resorts, do barbecue and many others.

You will get a chance to meeting the larger part of the Unikraft
community, and both be part of technical and social events with us.

If you like this, and if you would like to join, get in touch with me
(Razvan Deaconescu: razvand@unikraft.io) via e-mail.

[1] https://www.booking.com/hotel/ro/yael-luxury-apartments.html?lang=3Den-=
us
[2] https://romaniatourism.com/bucharest.html
[3] http://www.romania-travel-guide.com/en/attractions/mountain/bucegi-moun=
tains.html

Razvan



From minios-devel-bounces@lists.xenproject.org Mon Jul 08 08:02:07 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 08:02:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755113.1163374 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQjK2-0000p8-Tb; Mon, 08 Jul 2024 08:02:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755113.1163374; Mon, 08 Jul 2024 08:02:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQjK2-0000oa-LB; Mon, 08 Jul 2024 08:02:06 +0000
Received: by outflank-mailman (input) for mailman id 755113;
 Mon, 08 Jul 2024 08:02:06 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=suqh=OI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sQjK2-0000l8-1n
 for minios-devel@lists.xenproject.org; Mon, 08 Jul 2024 08:02:06 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5c5a12b2-3d00-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 10:02:03 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2ee8911b451so44684341fa.2
 for <minios-devel@lists.xenproject.org>; Mon, 08 Jul 2024 01:02: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
 d2e1a72fcca58-70b2eb78584sm1830354b3a.169.2024.07.08.01.01.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 08 Jul 2024 01:02:02 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c5a12b2-3d00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1720425722; x=1721030522; 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=BBGmLq09nC37TEnoNtj+D0NCHJwn049BW+yNaxMy4mw=;
        b=PdN+qiO07XAx+TaOgtsSeMs/jq1x384sqf6vyE44p6/K/84M/4KbJdnwQXq8vmmG2g
         iiTYmnH8aPuo8SYxazRd9TFuneLoWiqY4mObgdGbl/UJw079f9vndQNNWJeykuqk8wvu
         2UgUHDomsi7lEHvemJcAYyVTe49bIBLNv6QIp2G8AYDXWXpP78g2iyo1s2Q0mavaU/ka
         Zw/0sR3ijFwxHsoTmoJVfzzuNFhbk3m5icgNCT198yVZDsgTGHYRWU1aDUj9MONM9IG0
         RQP4m6/znyTgtn3eB6Svbd55AmyJlKdq4h29avT06hszewkl33FVsq6y0X7PsKaiGHb9
         SARQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720425722; x=1721030522;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BBGmLq09nC37TEnoNtj+D0NCHJwn049BW+yNaxMy4mw=;
        b=fY6EDGYraNGHYgq7klL0CHu714lNK307cA6XBQsQcuMJgrkzA4E9VeST9fngIQQiFA
         IIX3uiC6sCiHkcpphHchIWrvqRDZzbFvEEwHyyrZbGrGbJGmrbyG1STeCKPFvtsiUzto
         pqql6P9RSdfbMitfmVYosG81MfcfeRJW/Blad1dVD4Z9MZNSw8jC/oZILQyJF07jCNPZ
         ao+hSQjsAVGVxoJtAaCPBdY9oLYeThlVYyTNTHAQ5O33G3Ka49dvdA1nmVTJLwUGp5yL
         qp8MS/VrbgUvmtpGZzZhZaWvlYjSI6mTtknVYhRSIMpcWydKA86L+UDcm3hxGRa4bNTg
         ReJw==
X-Forwarded-Encrypted: i=1; AJvYcCU2elhPDAH57ialnBULm5LufpLlz8ndbA2Zl+Dnx5wPXB9hfnD46+jFYASHPGYXJWXro/JHM7v+hA7DrDdZd1Ua8ltl2I9bL2V1hI+6X+MR1ac=
X-Gm-Message-State: AOJu0YwSCsjs9ihesdm9XvhI59YR6A0QGm1LB21yoBLAmFJe1bwYQObx
	0VUuCRYhSwvx/pmAMY32peQcwLQHI6G4HjXyiP5X8j/j68rveTuKAoyJGZ6Tmw==
X-Google-Smtp-Source: AGHT+IHaxxfSCswIcatlh8blJpZdH4N5a8/iFUAWnfzl1Tszlq3RsbZTCd6VWncmnl577Dj13Zybvw==
X-Received: by 2002:a2e:8889:0:b0:2ec:3d2e:2408 with SMTP id 38308e7fff4ca-2ee8ee00250mr71357251fa.33.1720425722514;
        Mon, 08 Jul 2024 01:02:02 -0700 (PDT)
Message-ID: <2e9226a1-4196-4ff3-bea6-f8a2cf249dff@suse.com>
Date: Mon, 8 Jul 2024 10:01:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: Kelly Choi <kelly.choi@cloud.com>
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org,
 mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>,
 xen-devel <xen-devel@lists.xenproject.org>,
 "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>,
 win-pv-devel@lists.xenproject.org
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@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/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: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.07.2024 09:00, Kelly Choi wrote:
> Hi all,
> 
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.

+1

Jan

> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XAPI
> project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
> 
> I propose to tally the votes after July 31st, 2024. You can reply via email
> in public or private:
> +1: for proposal
> -1: against proposal
> 
> Based upon previous communication and rules for voting:
> The vote needs to achieve a 2/3 majority to pass.
> 
> Sub-project needs to achieve the following quorum of votes in favour for
> the sub-project’s vote to count:
> Hypervisor: 3 + votes
> XAPI: 2 + votes
> Windows PV Drivers: 1 + votes
> 
> Many thanks,
> Kelly Choi
> 
> Community Manager
> Xen Project
> 



From minios-devel-bounces@lists.xenproject.org Mon Jul 08 09:02:03 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 09:02:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755085.1163446 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQkG1-00044f-UF; Mon, 08 Jul 2024 09:02:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755085.1163446; Mon, 08 Jul 2024 09:02:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQkG1-00044Y-RB; Mon, 08 Jul 2024 09:02:01 +0000
Received: by outflank-mailman (input) for mailman id 755085;
 Mon, 08 Jul 2024 07:23:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sWbT=OI=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sQiih-000278-5w
 for minios-devel@lists.xenproject.org; Mon, 08 Jul 2024 07:23:31 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8c0ffa7-3cfa-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 09:23:28 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52ccc40e72eso1926876e87.3
 for <minios-devel@lists.xenproject.org>; Mon, 08 Jul 2024 00:23:28 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8c0ffa7-3cfa-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720423408; x=1721028208; 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=QA5XKySHBbQyTCaAwDrcN0EPTjdnFOPBEWnC3CbkYW0=;
        b=FnZrnRYm5+CLrE5a+v75zdg+ecqfB37DxYRsAC4wB2RF7kLy+ykJ7bDsv3BQDbp6eC
         kITzBJjbE/rlcKlH7P9lpMPgiqaBY81FgILuQJGOaTM6y6/ts8i3hq8sQkFK/iBNC6wN
         6LZBAmboJgbQhaFpnZ8IO0XlvWyVqv3r2qThU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720423408; x=1721028208;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=QA5XKySHBbQyTCaAwDrcN0EPTjdnFOPBEWnC3CbkYW0=;
        b=T3oTJfCSIhHeY3wqZbuTJ2jehVWpdVJAXfwfxzOJ9//LDUsnW9jf0N1cYV/8Jp060e
         1HAy4wwbtLvM/sz9N2KcCFS/nc2r8JoPXbYYDtqEIWdASXTX8STVaEjJtTlAnhSmrhuc
         1Q/PXQ/uH6l3ZvHrPsJ6+OgkoZvT35Z01d7Q0++IawQVsducem15XyUBEq9UXTYA5GXx
         5S0FU+4062sp4dQ8nUL07fZ2q3g9WXv1LeE+Bmuv/+4F8MNuXGO76JmbuGWoL3o8r7Q0
         pnA9HOdGJ8IqDqRBE0g/y/5j27hEz1thAifOolpnQjUCixciRPeh5hZpV/a6lwTHFQPR
         qrXg==
X-Forwarded-Encrypted: i=1; AJvYcCV7H8XlN3sokQ5efyABCemN10OxUA/9imjXrZ3OoyqsXTLq21LbL/mslisJmJD7P1tETNqfxxC5JSrpN6R+WMX4psrcr4IaafKvMYhvvctSfhw=
X-Gm-Message-State: AOJu0Yzc8adFFlV9rSVRiOjNyoHvxf7GXdmzNAqih5M4bbtGv/A2HjUA
	TfOJQyeyQfb1MzXKGBbc58WU5AeWYJ754aailufm8ZQdzopSCFIEM6O48+S9OPG7kUk2AWzHedt
	+CzJfuisT8Bj0NlweiSQ7TvPqWMLwJbWXcmN6
X-Google-Smtp-Source: AGHT+IFccTZJINWUE5iwTO3jg+NpURSgSFe3gLg8I1IMugGEqoLZMNPVbq7mLwVoWuCNOvk/e5rLlHTjh2WNsaY/ypk=
X-Received: by 2002:ac2:5050:0:b0:52e:747f:46d9 with SMTP id
 2adb3069b0e04-52ea0629af0mr8702168e87.17.1720423407795; Mon, 08 Jul 2024
 00:23:27 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
From: Owen Smith <owen.smith@cloud.com>
Date: Mon, 8 Jul 2024 08:23:15 +0100
Message-ID: <CAC_UY88mKye2Ti5pmOuFZqP1nR5WQdYXWeqGR7fdukjoFS2BmA@mail.gmail.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: Kelly Choi <kelly.choi@cloud.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, win-pv-devel@lists.xenproject.org, 
	committers@xenproject.org, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="00000000000015e34b061cb74a0a"

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

+1

On Mon, Jul 8, 2024 at 8:02=E2=80=AFAM Kelly Choi <kelly.choi@cloud.com> wr=
ote:

> Hi all,
>
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct tea=
m.
>
> As a result, Stefano will be the only member remaining on the CoC team. @=
Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.
>
> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XA=
PI
> project, and the Windows PV Driver project to vote on this proposal.
>
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
>
> I propose to tally the votes after July 31st, 2024. You can reply via
> email in public or private:
> +1: for proposal
> -1: against proposal
>
> Based upon previous communication and rules for voting:
> The vote needs to achieve a 2/3 majority to pass.
>
> Sub-project needs to achieve the following quorum of votes in favour for
> the sub-project=E2=80=99s vote to count:
> Hypervisor: 3 + votes
> XAPI: 2 + votes
> Windows PV Drivers: 1 + votes
>
> Many thanks,
> Kelly Choi
>
> Community Manager
> Xen Project
>

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

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">+1<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Mon, Jul 8, 2024 at 8:02=E2=80=AFAM Kelly Choi &lt;<a hr=
ef=3D"mailto:kelly.choi@cloud.com">kelly.choi@cloud.com</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi =
all,=C2=A0<div><br></div><div>As you are aware, George Dunlap has recently =
stepped down from the Xen Project as a committer, but he was also a part of=
 the Code of Conduct team.</div><div><br></div><div>As a result, Stefano wi=
ll be the only member remaining on the CoC team.=C2=A0<a class=3D"gmail_plu=
sreply" id=3D"m_4169227896029523200m_-6110525638451986579m_5217689757430685=
812m_2021811972426709313plusReplyChip-0" href=3D"mailto:roger.pau@cloud.com=
" target=3D"_blank">@Roger Pau Monne</a>=C2=A0has volunteered to join the t=
eam, so that there are at least two members.</div><div><br></div>In accorda=
nce with <a href=3D"https://xenproject.org/developers/governance/" target=
=3D"_blank">https://xenproject.org/developers/governance/</a>, I need the l=
eadership teams of the three mature projects: the Hypervisor, the XAPI proj=
ect, and the Windows PV Driver project to vote on this proposal.<br><br>The=
 specific voting rules, in this case, are outlined in the section: <a href=
=3D"https://www.xenproject.org/governance.html#project-decisions" target=3D=
"_blank">https://www.xenproject.org/governance.html#project-decisions</a><d=
iv><br></div><div>I propose to tally the votes after July 31st, 2024. You c=
an reply via email in public or private:<br>+1: for proposal<br>-1: against=
 proposal</div><div><br></div><div>Based upon previous communication and ru=
les for voting:</div><div>The vote needs to achieve a 2/3 majority to pass.=
<br></div><div><br>Sub-project needs to achieve the following quorum of vot=
es in favour for the sub-project=E2=80=99s vote to count:<br>Hypervisor: 3 =
+ votes<br>XAPI: 2 + votes<br>Windows PV Drivers: 1 + votes</div><div><br><=
/div><div><div>Many thanks,<br></div><div><div dir=3D"ltr" class=3D"gmail_s=
ignature"><div dir=3D"ltr"><div>Kelly Choi</div><div><br></div><div><div st=
yle=3D"color:rgb(136,136,136)">Community Manager</div><div style=3D"color:r=
gb(136,136,136)">Xen Project=C2=A0<br></div></div></div></div></div></div><=
/div>
</blockquote></div>

--00000000000015e34b061cb74a0a--


From minios-devel-bounces@lists.xenproject.org Mon Jul 08 19:57:31 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 19:57:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755595.1163999 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQuUK-0004Zd-U6; Mon, 08 Jul 2024 19:57:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755595.1163999; Mon, 08 Jul 2024 19:57:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sQuUK-0004ZW-Rg; Mon, 08 Jul 2024 19:57:28 +0000
Received: by outflank-mailman (input) for mailman id 755595;
 Mon, 08 Jul 2024 19:57:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EgpN=OI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sQuUK-0004ZL-02
 for minios-devel@lists.xenproject.org; Mon, 08 Jul 2024 19:57:28 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b491391-3d64-11ef-bbfb-fd08da9f4363;
 Mon, 08 Jul 2024 21:57:27 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 476D0CE0F08;
 Mon,  8 Jul 2024 19:57:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90549C116B1;
 Mon,  8 Jul 2024 19:57:19 +0000 (UTC)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b491391-3d64-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1720468640;
	bh=vk8qUoPKpAVrK7exPxJCI1y8r71oNkMKkVp76PWQMx0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=jV/AuaB9sTgRCAKIQsFGqYS9JR8M6uNgYI9Z2k8hB7gbmPG8dTSythUFXEkhvM1Qi
	 cNu/5dPe7B6cwh91IXo38J2f8dZtVoJWK3kOISRJyEg2Xv82ypXlKMZDHOSaKB44ow
	 OJR/pikdr2KmtheovIKJ+qjyYi5AnFTlNGZJ4QutdN46yDYebM2JjcaiR1XNap0Fea
	 QQuo1Op0xVLI5XraR1MBwPufYjqGRwC8qq8XJknKYDrLmdi88ZLLGb8ZvDhbuseut1
	 2cICXiWdzYAIh77GANBuikDo96rSTbljDdp/dm+vl3peKuKrRlClooMFAkUt2uHBRw
	 u5zoqJiVpN0Og==
Date: Mon, 8 Jul 2024 12:57:18 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Kelly Choi <kelly.choi@cloud.com>
cc: xen-devel <xen-devel@lists.xenproject.org>, 
    "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, 
    win-pv-devel@lists.xenproject.org, committers@xenproject.org, 
    minios-devel@lists.xenproject.org, mirageos-devel@lists.xenproject.org, 
    Roger Pau Monne <roger.pau@cloud.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2407081257020.3635@ubuntu-linux-20-04-desktop>
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1861991062-1720468640=:3635"

  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-1861991062-1720468640=:3635
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Mon, 8 Jul 2024, Kelly Choi wrote:
> Hi all, 
> As you are aware, George Dunlap has recently stepped down from the Xen Project as a committer, but he was also a part of the Code of
> Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger Pau Monne has volunteered to join the team, so that there
> are at least two members.
> 
> In accordance with https://xenproject.org/developers/governance/, I need the leadership teams of the three mature projects: the Hypervisor,
> the XAPI project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section: https://www.xenproject.org/governance.html#project-decisions
> I propose to tally the votes after July 31st, 2024. You can reply via email in public or private:
> +1: for proposal
> -1: against proposal

+1
--8323329-1861991062-1720468640=:3635--


From minios-devel-bounces@lists.xenproject.org Tue Jul 09 05:43:03 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 05:43:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755704.1164144 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sR3cw-0005BS-Hw; Tue, 09 Jul 2024 05:42:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755704.1164144; Tue, 09 Jul 2024 05: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sR3cw-0005Av-BB; Tue, 09 Jul 2024 05:42:58 +0000
Received: by outflank-mailman (input) for mailman id 755704;
 Tue, 09 Jul 2024 05:42:57 +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 1sR3cv-00058H-EX; Tue, 09 Jul 2024 05:42:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sR3cs-00033e-VZ; Tue, 09 Jul 2024 05:42:54 +0000
Received: from buscust21-202.static.cytanet.com.cy ([87.228.190.202]
 helo=[10.10.49.222]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sR3cs-0008No-LT; Tue, 09 Jul 2024 05:42:54 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-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=gY3HaePMaabOigPfAFjjtMH3zQ3Cfhd/KFBFRw1r2MU=; b=acUmgCqipKcHBnC/ZZAeGNLaaE
	1CKeHnCvWf6TSqL3z1v6tc1d9TYEYwDnhMSmIzyUSou+y0WbmpeDbjwLdvRYTrtHqXXRiLji9vaLC
	ekqKCz1Id4qyjYQEQ3JG9tiban7vZJ7n7uaXVfWeqG39QFIs7XTl9v2g0N+hW6QgwTDA=;
Message-ID: <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
Date: Tue, 9 Jul 2024 08:42:50 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
Content-Language: en-GB
To: Kelly Choi <kelly.choi@cloud.com>,
 xen-devel <xen-devel@lists.xenproject.org>,
 "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>,
 win-pv-devel@lists.xenproject.org
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org,
 mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 08/07/2024 10:00, Kelly Choi wrote:
> Hi all,
> 
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.
> 
> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XAPI
> project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
> 
> I propose to tally the votes after July 31st, 2024. You can reply via email
> in public or private:
> +1: for proposal
> -1: against proposal

+1

Cheers,

-- 
Julien Grall


From minios-devel-bounces@lists.xenproject.org Fri Jul 19 11:19:29 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 19 Jul 2024 11:19:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.760993.1170985 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sUle3-0002Ls-OL; Fri, 19 Jul 2024 11:19:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 760993.1170985; Fri, 19 Jul 2024 11:19:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sUle3-0002Ll-Ls; Fri, 19 Jul 2024 11:19:27 +0000
Received: by outflank-mailman (input) for mailman id 760993;
 Fri, 19 Jul 2024 11:13:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Y74h=OT=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sUlYV-0001YJ-US
 for minios-devel@lists.xenproject.org; Fri, 19 Jul 2024 11:13:43 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f4dd468c-45bf-11ef-bbfd-fd08da9f4363;
 Fri, 19 Jul 2024 13:13:42 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5a3458bf989so476767a12.0
 for <minios-devel@lists.xenproject.org>; Fri, 19 Jul 2024 04:13:42 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4dd468c-45bf-11ef-bbfd-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1721387622; x=1721992422; 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=5e7wKCkzNVlPlHXDTLl/rmjv17vv+TYao9fpalfP0SY=;
        b=ADwOtJLbN+JvJpno4O8CnEb87H2z/D5AhH44F28stOJGxuUpiTTZBTox+J58gVyqYh
         ZSKWJFVk6yQ3nA3RCTtz4zQrHrdcGuDuGI+kfaTO3tBxgFC43FUTF51Uko36QIdHUwkQ
         oZaghE/BbD9neA63QOAxrHy3DJXUt3YgAkBl0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721387622; x=1721992422;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=5e7wKCkzNVlPlHXDTLl/rmjv17vv+TYao9fpalfP0SY=;
        b=R0MKaSQ6fw2zcplw3qWD4z6qxc7GtjpCN4/wDsUZsM2WWdq35mQ8a0LgiompYIaB4c
         4ymXqlEmMsLo7uGdryN4PQcyvMJ8GQ5kqBlrq64SOr7ssHhPdFFQJoPusZlGjRRn4t4x
         K415ikJMFo62CjRCHDDGp+HEUMTOt2bZYS6BlJO8N/UDc2StGhqinPW1bVNkvZsVxes2
         qve8WkHEFmVheqiRHmNapjwjLw6jKlNiUN9WvxPiRTRNx9GSZxc5mMngFLoh951G1F18
         jc5GaJGBVtz7WgdoeGjhSvwT2sAAgkbNffS4t9PX/d+ON+kj9c5QgasWW/n3v6r3nvcF
         vj3g==
X-Forwarded-Encrypted: i=1; AJvYcCUT4zOcQkKXV7UHQN9VxxvvxwmK3k9SP3HBf3+omDPXVlzfCO6wby8T44tgaJNjNT83lejLUl4KjoYkmFijqp/34lTiqrmEKC+3bal+LmYeLrM=
X-Gm-Message-State: AOJu0Ywq+nAvN0Mt2Ji8ghoJ+XkobM4wj7nbiizM1jrjhkVWSCX5WO33
	KEtOeV1dlVM3lPUH8srdqS7oTvt0cdnGHI/4DPU6M7pciLKLhUf3HL0duD0/8ZWY1gGZzJh3u7q
	a2hXZvQEgW3OCghcTBCX0NUrEB2W37so3fcuE0Q==
X-Google-Smtp-Source: AGHT+IE2E6/0CR/edfh7Q2HPb/VFViuIMYHUXMOIzEDWTbjY5p+yMMocv/qWDt07IMeaBdZj5Uh0C1g8GkzU4fm8wKg=
X-Received: by 2002:a17:906:2f0b:b0:a77:dbf0:d30 with SMTP id
 a640c23a62f3a-a7a011b6466mr523528966b.41.1721387621269; Fri, 19 Jul 2024
 04:13:41 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
 <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
In-Reply-To: <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
From: Kelly Choi <kelly.choi@cloud.com>
Date: Fri, 19 Jul 2024 12:13:05 +0100
Message-ID: <CAO-mL=yhMDuvMOWHU93jNLgxOJe4_Bir44UC23+HoAfj0yK=Tw@mail.gmail.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: win-pv-devel@lists.xenproject.org, 
	xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org
Cc: committers@xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="000000000000afe24c061d97c966"

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

Hi all,

I have received all votes from leadership teams of three mature projects
and achieved a quorum on this proposal.
Votes have been received both in public and private.

The outcome of votes:
Hypervisor: +3
Windows PV: +2
XAPI: +2

Roger will be added as the new code of conduct team member.

Many thanks,
Kelly Choi

Community Manager
Xen Project


On Tue, Jul 9, 2024 at 6:42=E2=80=AFAM Julien Grall <julien@xen.org> wrote:

>
>
> On 08/07/2024 10:00, Kelly Choi wrote:
> > Hi all,
> >
> > As you are aware, George Dunlap has recently stepped down from the Xen
> > Project as a committer, but he was also a part of the Code of Conduct
> team.
> >
> > As a result, Stefano will be the only member remaining on the CoC team.
> @Roger
> > Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so
> that
> > there are at least two members.
> >
> > In accordance with https://xenproject.org/developers/governance/, I nee=
d
> > the leadership teams of the three mature projects: the Hypervisor, the
> XAPI
> > project, and the Windows PV Driver project to vote on this proposal.
> >
> > The specific voting rules, in this case, are outlined in the section:
> > https://www.xenproject.org/governance.html#project-decisions
> >
> > I propose to tally the votes after July 31st, 2024. You can reply via
> email
> > in public or private:
> > +1: for proposal
> > -1: against proposal
>
> +1
>
> Cheers,
>
> --
> Julien Grall
>

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

<div dir=3D"ltr"><div dir=3D"ltr">Hi all,<div><br></div><div>I have receive=
d all votes from leadership=C2=A0teams=C2=A0of three mature projects and ac=
hieved a quorum=C2=A0on this proposal.</div><div>Votes have been received b=
oth in public and private.</div><div><br></div><div>The outcome of votes:</=
div><div>Hypervisor:=C2=A0+3</div><div>Windows PV:=C2=A0+2</div><div>XAPI:=
=C2=A0+2</div><div><br></div><div>Roger will be added as the new code of co=
nduct team member.=C2=A0</div><div><br></div><div><div><div dir=3D"ltr" cla=
ss=3D"gmail_signature"><div dir=3D"ltr"><div>Many thanks,</div><div>Kelly C=
hoi</div><div><br></div><div><div style=3D"color:rgb(136,136,136)">Communit=
y Manager</div><div style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<br><=
/div></div></div></div></div><br></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 9, 2024 at 6:42=E2=80=AF=
AM Julien Grall &lt;<a href=3D"mailto:julien@xen.org">julien@xen.org</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 08/07/2024 10:00, Kelly Choi wrote:<br>
&gt; Hi all,<br>
&gt; <br>
&gt; As you are aware, George Dunlap has recently stepped down from the Xen=
<br>
&gt; Project as a committer, but he was also a part of the Code of Conduct =
team.<br>
&gt; <br>
&gt; As a result, Stefano will be the only member remaining on the CoC team=
. @Roger<br>
&gt; Pau Monne &lt;<a href=3D"mailto:roger.pau@cloud.com" target=3D"_blank"=
>roger.pau@cloud.com</a>&gt; has volunteered to join the team, so that<br>
&gt; there are at least two members.<br>
&gt; <br>
&gt; In accordance with <a href=3D"https://xenproject.org/developers/govern=
ance/" rel=3D"noreferrer" target=3D"_blank">https://xenproject.org/develope=
rs/governance/</a>, I need<br>
&gt; the leadership teams of the three mature projects: the Hypervisor, the=
 XAPI<br>
&gt; project, and the Windows PV Driver project to vote on this proposal.<b=
r>
&gt; <br>
&gt; The specific voting rules, in this case, are outlined in the section:<=
br>
&gt; <a href=3D"https://www.xenproject.org/governance.html#project-decision=
s" rel=3D"noreferrer" target=3D"_blank">https://www.xenproject.org/governan=
ce.html#project-decisions</a><br>
&gt; <br>
&gt; I propose to tally the votes after July 31st, 2024. You can reply via =
email<br>
&gt; in public or private:<br>
&gt; +1: for proposal<br>
&gt; -1: against proposal<br>
<br>
+1<br>
<br>
Cheers,<br>
<br>
-- <br>
Julien Grall<br>
</blockquote></div></div>

--000000000000afe24c061d97c966--


From minios-devel-bounces@lists.xenproject.org Fri Jul 19 15:57:16 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 19 Jul 2024 15:57:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761131.1171120 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sUpyp-0004Nt-JG; Fri, 19 Jul 2024 15:57:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761131.1171120; Fri, 19 Jul 2024 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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sUpyp-0004Nm-Gd; Fri, 19 Jul 2024 15:57:11 +0000
Received: by outflank-mailman (input) for mailman id 761131;
 Fri, 19 Jul 2024 15:57:09 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=17VY=OT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sUpyn-0004Nb-Gy
 for minios-devel@lists.xenproject.org; Fri, 19 Jul 2024 15:57:09 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8bd167b6-45e7-11ef-8776-851b0ebba9a2;
 Fri, 19 Jul 2024 17:57:06 +0200 (CEST)
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 AB79721195;
 Fri, 19 Jul 2024 15:57: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 79FEE13808;
 Fri, 19 Jul 2024 15:57: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 4DMvHM+MmmaMDwAAD6G6ig
 (envelope-from <jgross@suse.com>); Fri, 19 Jul 2024 15:57:03 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bd167b6-45e7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721404624; 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=njpne1O7ESlKbpj2bubjPeYyxpHa6RmoveMWlnfX5zU=;
	b=fs1dzQMkHOadYC4nCcDWjH3kCol2VQPjBs+vKmAp62Pep/8zpd9EC4/XtQNa5xuGugfYaq
	Z98SxV0e7AqBitl1YAdPTjKXFFD0+Pi0B4iMjwNwSr04poOotup659Lr8K1lPB0axgVzc7
	6Dmv2NKYmchhlt31d7Gwfr4JARpc75E=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=WfMSsv4A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721404623; 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=njpne1O7ESlKbpj2bubjPeYyxpHa6RmoveMWlnfX5zU=;
	b=WfMSsv4AzLpQsDqFAn3i1AbfDS1OnUe11A8FOR+i3tQeZ1WGMb4qrg4EhVljXdXPMFdamw
	6zCeZdtOLMMCFSWaJwJS2GrGBffaLH7E+yRTijCHv89FHR5jRVz5m6aBl2uOACXWV00H6L
	8xgtlgRNZzhXlCapbOVue2lwCti0zck=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2] Mini-OS: add some macros for asm statements
Date: Fri, 19 Jul 2024 17:57:01 +0200
Message-ID: <20240719155701.18856-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [0.19 / 50.00];
	MID_CONTAINS_FROM(1.00)[];
	DWL_DNSWL_LOW(-1.00)[suse.com:dkim];
	R_MISSING_CHARSET(0.50)[];
	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)[];
	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)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:dkim,suse.com:email];
	FROM_HAS_DN(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_FIVE(0.00)[5];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spam-Level: 
X-Rspamd-Queue-Id: AB79721195
X-Spam-Score: 0.19
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Bar: /

Instead of having #ifdefs sprinkled around in x86 code, add some
macros defining constants for asm statements to address differences
between 32- and 64-bit mode.

Modify existing code to use those macros.

While at it convert the assembler parts of run_idle_thread() to a more
sane variant.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- addressed comments by Andrew Cooper
---
 arch/x86/sched.c | 34 ++++++++++------------------------
 include/x86/os.h | 18 ++++++++++--------
 2 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/arch/x86/sched.c b/arch/x86/sched.c
index dabe6fd6..42805f9f 100644
--- a/arch/x86/sched.c
+++ b/arch/x86/sched.c
@@ -60,16 +60,10 @@ void dump_stack(struct thread *thread)
     unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); 
     unsigned long *pointer = (unsigned long *)thread->sp;
     int count;
-    if(thread == current)
-    {
-#ifdef __i386__    
-        asm("movl %%esp,%0"
-            : "=r"(pointer));
-#else
-        asm("movq %%rsp,%0"
-            : "=r"(pointer));
-#endif
-    }
+
+    if ( thread == current )
+        asm("mov %%"ASM_SP",%0" : "=r"(pointer));
+
     printk("The stack for \"%s\"\n", thread->name);
     for(count = 0; count < 25 && pointer < bottom; count ++)
     {
@@ -119,20 +113,12 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
 
 void run_idle_thread(void)
 {
-    /* Switch stacks and run the thread */ 
-#if defined(__i386__)
-    __asm__ __volatile__("mov %0,%%esp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
-                         :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                          
-#elif defined(__x86_64__)
-    __asm__ __volatile__("mov %0,%%rsp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
-                         :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                                                    
-#endif
+    /* Switch stacks and run the thread */
+    asm volatile ("mov %[sp], %%"ASM_SP"\n\t"
+                  "jmp *%[ip]\n\t"
+                  :
+                  : [sp] "m" (idle_thread->sp),
+                    [ip] "m" (idle_thread->ip));
 }
 
 unsigned long __local_irq_save(void)
diff --git a/include/x86/os.h b/include/x86/os.h
index ee34d784..0095be13 100644
--- a/include/x86/os.h
+++ b/include/x86/os.h
@@ -61,6 +61,16 @@
 #define TRAP_deferred_nmi     31
 #define TRAP_xen_callback     32
 
+#if defined(__i386__)
+#define __SZ    "l"
+#define __REG   "e"
+#else
+#define __SZ    "q"
+#define __REG   "r"
+#endif
+
+#define ASM_SP  __REG"sp"
+
 /* Everything below this point is not included by assembler (.S) files. */
 #ifndef __ASSEMBLY__
 
@@ -141,14 +151,6 @@ do {									\
 
 #else
 
-#if defined(__i386__)
-#define __SZ "l"
-#define __REG "e"
-#else
-#define __SZ "q"
-#define __REG "r"
-#endif
-
 #define __cli() asm volatile ( "cli" : : : "memory" )
 #define __sti() asm volatile ( "sti" : : : "memory" )
 
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 07:15:46 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 07:15:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761508.1171445 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVnGq-0008Da-Sr; Mon, 22 Jul 2024 07:15:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761508.1171445; Mon, 22 Jul 2024 07:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVnGq-0008DR-QH; Mon, 22 Jul 2024 07:15:44 +0000
Received: by outflank-mailman (input) for mailman id 761508;
 Mon, 22 Jul 2024 07:15:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=79tL=OW=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sVnGp-0007yW-2b
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 07:15:43 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 338f6386-47fa-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 09:15:42 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a77d9217e6fso366084966b.2
 for <minios-devel@lists.xenproject.org>; Mon, 22 Jul 2024 00: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
 a640c23a62f3a-a7a3c9233c5sm382848266b.185.2024.07.22.00.15.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 22 Jul 2024 00:15:39 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 338f6386-47fa-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1721632540; x=1722237340; 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=I+/Vgod0fktbuHqI7yZLmkeiuCeHf5w5rjOdro5VCqU=;
        b=USdB+YbGUFvmvi/4JTu0J8AYkGe/lzFnUwzZDnCx2H0mQtrNtgW400u7rlGWALzPJy
         fpa1kEmGkthvCaC478u2nSOYWUm96tTaPPi3Lz2+dxWjeUcqsfzmikwllYksUabcenP1
         wt3CfNvUFyMEhr9GbIXuxg//QfFYk4+tH1Afc7K6HPj/J4X1p0EkwfoLRMIjnpjzTLrL
         XsqgWHDYEKJWQYF3olproVG0TXndogXwZwag89FijT5ft0d8e1eOV1pNFOmciSwqsrPn
         7E0bF+1m8CvbGfgBEpsZx19a1AlzOV53Sm9Hp98KXFh8hr/wN/7ajywL/3YJK5Ha7ffz
         FnhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721632540; x=1722237340;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=I+/Vgod0fktbuHqI7yZLmkeiuCeHf5w5rjOdro5VCqU=;
        b=VA18BVxLEL0MQYkuQyU8bmvloOotl8TuNTmkoYC/pfCPOpC5XmohDzGPF4EkOBc6s8
         pBJ6Sr8BCuq2rjozxz2yuaKaakkqMsZzWBAXIQ1TyciB4OMdPKx/ay+kr58oVppKhIuB
         EHrA125eY/es595JUD71FtYQYKhix3hwVA+pRSCCYBvv4EaBoxTvPU6ac+cFZzbOf7zH
         STZIHjrAIQErvUgVcWZ+M9kcSMWBdIaL1OnnjVgDqayi+mUKKac6kmndK7+IdBO2L4Y6
         HRywfQBJ2gSqPtuaT2jYYiXmVnoKgVOLGi8dVUHKNOCxll0FCVU6uoPcm3/lpFf9fT29
         hdnQ==
X-Forwarded-Encrypted: i=1; AJvYcCVGvY9nKG0Q0EN7SwbBQ42828CsQTj5GRoFYqGtOQ7+1gAMmFqSX9mr6Fg1y42u8WWHsZStAUzc0qVSLkclDyKRk3HL/wAMxus1AnyFBIRqqWU=
X-Gm-Message-State: AOJu0YxpqgjW3P7HS+nmDt4vF/r0+D+gsvgsPNRGzKXnEpsTZNwmLkNR
	1310/T1rSJVbTZaWXXBNsNwPft/3yh6RIaOwB6jqdIamYrwvK4UQ4anC5TT/lA==
X-Google-Smtp-Source: AGHT+IGgYTCy7irMQCSlIXJ4qjae7T7NyhhHviRZAyBf6PzP4paIYcQcGtGbLIRSsiSayYaA0Ob7rA==
X-Received: by 2002:a17:906:6a19:b0:a75:25ff:550d with SMTP id a640c23a62f3a-a7a4c010608mr356163866b.26.1721632540008;
        Mon, 22 Jul 2024 00:15:40 -0700 (PDT)
Message-ID: <0c76f87a-ca46-4511-9a6d-9ffc10815295@suse.com>
Date: Mon, 22 Jul 2024 09:15:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Mini-OS: add some macros for asm statements
To: Juergen Gross <jgross@suse.com>
Cc: samuel.thibault@ens-lyon.org, wl@xen.org,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
References: <20240719155701.18856-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: <20240719155701.18856-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 19.07.2024 17:57, Juergen Gross wrote:
> --- a/arch/x86/sched.c
> +++ b/arch/x86/sched.c
> @@ -60,16 +60,10 @@ void dump_stack(struct thread *thread)
>      unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); 
>      unsigned long *pointer = (unsigned long *)thread->sp;
>      int count;
> -    if(thread == current)
> -    {
> -#ifdef __i386__    
> -        asm("movl %%esp,%0"
> -            : "=r"(pointer));
> -#else
> -        asm("movq %%rsp,%0"
> -            : "=r"(pointer));
> -#endif
> -    }
> +
> +    if ( thread == current )
> +        asm("mov %%"ASM_SP",%0" : "=r"(pointer));

As you switch the if() to Xen style, why not also the asm()? Irrespective of
which precise style is meant to be used, the last closing double quote likely
also wants to be followed by a blank?

> @@ -119,20 +113,12 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
>  
>  void run_idle_thread(void)
>  {
> -    /* Switch stacks and run the thread */ 
> -#if defined(__i386__)
> -    __asm__ __volatile__("mov %0,%%esp\n\t"
> -                         "push %1\n\t" 
> -                         "ret"                                            
> -                         :"=m" (idle_thread->sp)
> -                         :"m" (idle_thread->ip));                          
> -#elif defined(__x86_64__)
> -    __asm__ __volatile__("mov %0,%%rsp\n\t"
> -                         "push %1\n\t" 
> -                         "ret"                                            
> -                         :"=m" (idle_thread->sp)
> -                         :"m" (idle_thread->ip));                                                    
> -#endif
> +    /* Switch stacks and run the thread */
> +    asm volatile ("mov %[sp], %%"ASM_SP"\n\t"
> +                  "jmp *%[ip]\n\t"
> +                  :
> +                  : [sp] "m" (idle_thread->sp),
> +                    [ip] "m" (idle_thread->ip));
>  }

Here instead you look to be switching to Linux style. Was that intended?

As an aside, I think the construct is slightly problematic: In principle
the compiler could make a copy of idle_thread->ip on the stack. (It
won't normally, for code efficiency reasons.) That would break with the
earlier change of the stack pointer. Using an "r" constraint would
perhaps be better there. Yet if so wanted, that would certainly be a
separate change.

With the adjustments (or respective clarifications as to style intentions),
which I'd be fine making while committing so long as you agree:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 08:44:29 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 08:44:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761540.1171500 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVoef-0003qh-Hi; Mon, 22 Jul 2024 08:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761540.1171500; Mon, 22 Jul 2024 08: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sVoef-0003qa-FD; Mon, 22 Jul 2024 08:44:25 +0000
Received: by outflank-mailman (input) for mailman id 761540;
 Mon, 22 Jul 2024 08:44:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVoee-0003qP-MO
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 08:44:24 +0000
Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com
 [2a00:1450:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 983015b1-4806-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 10:44:23 +0200 (CEST)
Received: by mail-wr1-x435.google.com with SMTP id
 ffacd0b85a97d-368663d7f80so1959837f8f.3
 for <minios-devel@lists.xenproject.org>; Mon, 22 Jul 2024 01:44:23 -0700 (PDT)
Received: from ?IPV6:2003:e5:8729:4000:29eb:6d9d:3214:39d2?
 (p200300e58729400029eb6d9d321439d2.dip0.t-ipconnect.de.
 [2003:e5:8729:4000:29eb:6d9d:3214:39d2])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-36878695b35sm7838042f8f.65.2024.07.22.01.44.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 22 Jul 2024 01:44:22 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 983015b1-4806-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1721637863; x=1722242663; 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=UFBoWcoE3evfRn0nNP6dRYYq9iO7MVB6qLa15fL9t7Q=;
        b=Uo2m62ixw4vnpMC9bpF1z2+0rWS8lC+IjySRd9O0JUU0/RcLEi4Q3bhGEVXHCyGHGh
         df2GkKiCzsZCthHJgUufsyOuATtPLbSIZub9xLlr90+L513BaruWcBRMk7uebVvhO59a
         S7N3l0EjfW/UCkfLnZOJjJVa55LiWzi6tbGrSnNUFGGa+YDt/Oo/e90rI9ZxKjiyztvC
         ct3DFoCH6u7NWqWlMbZAOjL7uaBbwAXisY/araxxg4aEleDmdHdeVylRu0WTETnBXu6F
         jHN9ysaKEJjRC0daBwxnrMl58XI/RNDX1te31gvPHjQpsuyHdAjtsew2wHLodj1SKwX8
         VlUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721637863; x=1722242663;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=UFBoWcoE3evfRn0nNP6dRYYq9iO7MVB6qLa15fL9t7Q=;
        b=JYk1SMMlcTLp91gyclKV+qU/OAWrVbdn2mHAx+iYYokRzOe1fSqTj+VTrr4dWHe0Ln
         rsaU+l+XbsV0bUjTp5gkYoi2jv4Crej2dS8Lvy4p/RdVhHK97C4Qkx3HwcmI/IRKyOyK
         g2gGwumFPmyaFwW5B/fKBPVx956GehoeZJ4BWmzBqkfzzdXwxtT0WHRlGRo6XT90I1K7
         E/e/Amm8NrVdRMMMztrq+ORoGlbcxgeiVh7GbPwRJVznH9bce5/sPWaMxyQtJS6sANSM
         LblbuT9zm8xAQKn6neaGxT9y6S+TmR5k7Gk+JPjht9F8a3lW9RAoxunAbdGGyLipDbsW
         UvEQ==
X-Forwarded-Encrypted: i=1; AJvYcCWnyILGTJFBZ7bJv530rDqp3W7tA7fyYpiQ+V5K8MdGl0L1Om/sxWHYhrG1vXvG69+T/jzDJGsuFYKaubTGZkRSYRD9G0O2cKKH5gsmkbKVeS4=
X-Gm-Message-State: AOJu0YzeA83rBjH5xIH/k6sFnt2JRO8lI+U+pFo2KXmi9dDEn/95v2jh
	v8MkAGIKQsW4ky/5/b/P5VvTzFQwca9GYaP5HNFvFWz3nv8GCTQRuGhuMRCuHgg=
X-Google-Smtp-Source: AGHT+IH+jT7+d+FJfyFu0P7nCL8Pi7p0bwAMhnxDzQvjaGbBn/zuLdx9sWZdEZbSjxQe4ysjIEe1Xw==
X-Received: by 2002:a5d:4285:0:b0:367:84fe:cd79 with SMTP id ffacd0b85a97d-369bb2a169dmr3436826f8f.49.1721637862730;
        Mon, 22 Jul 2024 01:44:22 -0700 (PDT)
Message-ID: <bb5ff62e-8dc9-4d31-82d8-803bd8fa77a3@suse.com>
Date: Mon, 22 Jul 2024 10:44:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Mini-OS: add some macros for asm statements
To: Jan Beulich <jbeulich@suse.com>
Cc: samuel.thibault@ens-lyon.org, wl@xen.org,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
References: <20240719155701.18856-1-jgross@suse.com>
 <0c76f87a-ca46-4511-9a6d-9ffc10815295@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <0c76f87a-ca46-4511-9a6d-9ffc10815295@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 22.07.24 09:15, Jan Beulich wrote:
> On 19.07.2024 17:57, Juergen Gross wrote:
>> --- a/arch/x86/sched.c
>> +++ b/arch/x86/sched.c
>> @@ -60,16 +60,10 @@ void dump_stack(struct thread *thread)
>>       unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE);
>>       unsigned long *pointer = (unsigned long *)thread->sp;
>>       int count;
>> -    if(thread == current)
>> -    {
>> -#ifdef __i386__
>> -        asm("movl %%esp,%0"
>> -            : "=r"(pointer));
>> -#else
>> -        asm("movq %%rsp,%0"
>> -            : "=r"(pointer));
>> -#endif
>> -    }
>> +
>> +    if ( thread == current )
>> +        asm("mov %%"ASM_SP",%0" : "=r"(pointer));
> 
> As you switch the if() to Xen style, why not also the asm()? Irrespective of
> which precise style is meant to be used, the last closing double quote likely
> also wants to be followed by a blank?

Yes, indeed.

> 
>> @@ -119,20 +113,12 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
>>   
>>   void run_idle_thread(void)
>>   {
>> -    /* Switch stacks and run the thread */
>> -#if defined(__i386__)
>> -    __asm__ __volatile__("mov %0,%%esp\n\t"
>> -                         "push %1\n\t"
>> -                         "ret"
>> -                         :"=m" (idle_thread->sp)
>> -                         :"m" (idle_thread->ip));
>> -#elif defined(__x86_64__)
>> -    __asm__ __volatile__("mov %0,%%rsp\n\t"
>> -                         "push %1\n\t"
>> -                         "ret"
>> -                         :"=m" (idle_thread->sp)
>> -                         :"m" (idle_thread->ip));
>> -#endif
>> +    /* Switch stacks and run the thread */
>> +    asm volatile ("mov %[sp], %%"ASM_SP"\n\t"
>> +                  "jmp *%[ip]\n\t"
>> +                  :
>> +                  : [sp] "m" (idle_thread->sp),
>> +                    [ip] "m" (idle_thread->ip));
>>   }
> 
> Here instead you look to be switching to Linux style. Was that intended?

No, not really. I took Andrew's suggestion verbatim.

> As an aside, I think the construct is slightly problematic: In principle
> the compiler could make a copy of idle_thread->ip on the stack. (It
> won't normally, for code efficiency reasons.) That would break with the
> earlier change of the stack pointer. Using an "r" constraint would
> perhaps be better there. Yet if so wanted, that would certainly be a
> separate change.
> 
> With the adjustments (or respective clarifications as to style intentions),
> which I'd be fine making while committing so long as you agree:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks. I agree with the suggested changes (to spell it out explicitly: I
meant to use Xen coding style, as this is the Mini-OS style, too).


Juergen


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 12:16:52 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 12:16:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761811.1171845 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryE-0005r5-45; Mon, 22 Jul 2024 12:16:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761811.1171845; Mon, 22 Jul 2024 12:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryE-0005qy-1a; Mon, 22 Jul 2024 12:16:50 +0000
Received: by outflank-mailman (input) for mailman id 761811;
 Mon, 22 Jul 2024 12:16:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVryC-0005pO-V6
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 12:16:49 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 448aced4-4824-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 14:16:48 +0200 (CEST)
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 34A7321843;
 Mon, 22 Jul 2024 12:16: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 EC4FB138A7;
 Mon, 22 Jul 2024 12:16:46 +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 vDMyOK5NnmYTIQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 12:16:46 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 448aced4-4824-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650607; 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=AmTH1bdtVrV51iovoJz8Exw121j4vBzhMUgVftZpBis=;
	b=QT405tGcNsMbcngREX5lFOuaz4Ak0YgpfDPkoDVkBeqGdFUuVhGGEiuJFr1jbTd2aZLf7U
	QcauGptgjwbqwRBzDI99VeLcocynRXkVBCzBqd+hQrLia8+F5BtoIbkkkQW5k2wVtk5P8k
	UejZr9Dzu317WJjbYDIiOTW1pjxklMI=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=QT405tGc
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650607; 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=AmTH1bdtVrV51iovoJz8Exw121j4vBzhMUgVftZpBis=;
	b=QT405tGcNsMbcngREX5lFOuaz4Ak0YgpfDPkoDVkBeqGdFUuVhGGEiuJFr1jbTd2aZLf7U
	QcauGptgjwbqwRBzDI99VeLcocynRXkVBCzBqd+hQrLia8+F5BtoIbkkkQW5k2wVtk5P8k
	UejZr9Dzu317WJjbYDIiOTW1pjxklMI=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 0/3] Mini-OS: tidy up arch/x86/time.c
Date: Mon, 22 Jul 2024 14:16:40 +0200
Message-ID: <20240722121643.18116-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-0.81 / 50.00];
	MID_CONTAINS_FROM(1.00)[];
	DWL_DNSWL_LOW(-1.00)[suse.com:dkim];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	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:dkim];
	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)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_FIVE(0.00)[5];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spam-Level: 
X-Rspamd-Queue-Id: 34A7321843
X-Spam-Score: -0.81
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Bar: /

Make arch/x86/time.c coding style compliant, remove some unneeded cruft
and simplify the time keeping logic.

Juergen Gross (3):
  mini-os: apply coding style to arch/x86/time.c
  mini-os: remove some not needed stuff from arch/x86/time.c
  mini-os: simplify monotonic_clock()

 arch/x86/time.c | 188 ++++++++++++++++++------------------------------
 1 file changed, 69 insertions(+), 119 deletions(-)

-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 12:16:59 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 12:16:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761814.1171865 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryN-0006KJ-Ol; Mon, 22 Jul 2024 12:16:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761814.1171865; Mon, 22 Jul 2024 12:16:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryN-0006Jg-Ix; Mon, 22 Jul 2024 12:16:59 +0000
Received: by outflank-mailman (input) for mailman id 761814;
 Mon, 22 Jul 2024 12:16:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVryM-0006Ev-PT
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 12:16:58 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 483712e1-4824-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 14:16:54 +0200 (CEST)
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 C4D9A1FB6A;
 Mon, 22 Jul 2024 12:16: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 9448D138A7;
 Mon, 22 Jul 2024 12:16: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 w1nCIrRNnmYbIQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 12:16:52 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 483712e1-4824-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650613; 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=azTkaup4SqcuXAb/LgH2nIaT96hnmtfLlbNKG39T8n0=;
	b=cHfLAaeM5m/6kHQ2AmUVH+jezHClRl/cCzVQWAl41We+/EprJ5CeoNMLPh5H8EVV9KyYjE
	618MfpFdd9a1qo5tmpBGV7Ivd/8aZpQ6pPAvGo1cAsjf7EgMvYiQtWD7fQMUpsk2/OjOmy
	pfQPYACWnH7P3h0+1IgxiLzu2LxG2EQ=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650612; 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=azTkaup4SqcuXAb/LgH2nIaT96hnmtfLlbNKG39T8n0=;
	b=hk4wFdMEhXUdpgb1W2B1qYVV0hPthXHmjmw7AaZsDZFIUUXCmPbGrKHrQ3JIuvI3YoLsA3
	MTgEl+E+3m8JTKW9jhYnYrywH8cq5KCbDWsqCWmrko233GhM9pnFoVaMTu9NDSj3dan9eU
	ZVRVY7BvBJPRDR1RDSWznm/cCK52o80=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 1/3] mini-os: apply coding style to arch/x86/time.c
Date: Mon, 22 Jul 2024 14:16:41 +0200
Message-ID: <20240722121643.18116-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722121643.18116-1-jgross@suse.com>
References: <20240722121643.18116-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.60
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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)[imap1.dmz-prg2.suse.org:helo,suse.com:email];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO

Apply the preferred coding style to arch/x86/time.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/time.c | 194 +++++++++++++++++++++++-------------------------
 1 file changed, 93 insertions(+), 101 deletions(-)

diff --git a/arch/x86/time.c b/arch/x86/time.c
index 332c0260..a473a9e1 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -1,7 +1,7 @@
 /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
- * (C) 2002-2003 - Keir Fraser - University of Cambridge 
+ * (C) 2002-2003 - Keir Fraser - University of Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  * (C) 2006 - Robert Kaiser - FH Wiesbaden
  ****************************************************************************
@@ -18,20 +18,19 @@
  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  * sell copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
-
 #include <mini-os/os.h>
 #include <mini-os/traps.h>
 #include <mini-os/types.h>
@@ -46,44 +45,43 @@
 
 /* These are peridically updated in shared_info, and then copied here. */
 struct shadow_time_info {
-	uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
-	uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
-	uint32_t tsc_to_nsec_mul;
-	uint32_t tsc_to_usec_mul;
-	int tsc_shift;
-	uint32_t version;
+    uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
+    uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
+    uint32_t tsc_to_nsec_mul;
+    uint32_t tsc_to_usec_mul;
+    int tsc_shift;
+    uint32_t version;
 };
 static struct timespec shadow_ts;
 static uint32_t shadow_ts_version;
 
 static struct shadow_time_info shadow;
 
-
 #ifndef rmb
-#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
 #endif
 
-#define HANDLE_USEC_OVERFLOW(_tv)          \
-    do {                                   \
+#define HANDLE_USEC_OVERFLOW(_tv)           \
+    do {                                    \
         while ( (_tv)->tv_usec >= 1000000 ) \
-        {                                  \
+        {                                   \
             (_tv)->tv_usec -= 1000000;      \
             (_tv)->tv_sec++;                \
-        }                                  \
+        }                                   \
     } while ( 0 )
 
 static inline int time_values_up_to_date(void)
 {
-	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time; 
+    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
-	return (shadow.version == src->version);
+    return shadow.version == src->version;
 }
 
 static inline int wc_values_up_to_date(void)
 {
-	shared_info_t *s= HYPERVISOR_shared_info;
+    shared_info_t *s = HYPERVISOR_shared_info;
 
-	return (shadow_ts_version == s->wc_version);
+    return shadow_ts_version == s->wc_version;
 }
 
 /*
@@ -92,109 +90,104 @@ static inline int wc_values_up_to_date(void)
  */
 static inline uint64_t scale_delta(uint64_t delta, uint32_t mul_frac, int shift)
 {
-	uint64_t product;
+    uint64_t product;
 #ifdef __i386__
-	uint32_t tmp1, tmp2;
+    uint32_t tmp1, tmp2;
 #endif
 
-	if ( shift < 0 )
-		delta >>= -shift;
-	else
-		delta <<= shift;
+    if ( shift < 0 )
+        delta >>= -shift;
+    else
+        delta <<= shift;
 
 #ifdef __i386__
-	__asm__ (
-		"mul  %5       ; "
-		"mov  %4,%%eax ; "
-		"mov  %%edx,%4 ; "
-		"mul  %5       ; "
-		"add  %4,%%eax ; "
-		"xor  %5,%5    ; "
-		"adc  %5,%%edx ; "
-		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
-		: "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) );
+    __asm__ (
+        "mul  %5       ; "
+        "mov  %4,%%eax ; "
+        "mov  %%edx,%4 ; "
+        "mul  %5       ; "
+        "add  %4,%%eax ; "
+        "xor  %5,%5    ; "
+        "adc  %5,%%edx ; "
+        : "=A" (product), "=r" (tmp1), "=r" (tmp2)
+        : "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) );
 #else
-	__asm__ (
-		"mul %%rdx ; shrd $32,%%rdx,%%rax"
-		: "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) );
+    __asm__ (
+        "mul %%rdx ; shrd $32,%%rdx,%%rax"
+        : "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) );
 #endif
 
-	return product;
+    return product;
 }
 
-
 static unsigned long get_nsec_offset(void)
 {
-	uint64_t now, delta;
-	rdtscll(now);
-	delta = now - shadow.tsc_timestamp;
-	return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
-}
+    uint64_t now, delta;
 
+    rdtscll(now);
+    delta = now - shadow.tsc_timestamp;
+
+    return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
+}
 
 static void get_time_values_from_xen(void)
 {
-	struct vcpu_time_info    *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
-
- 	do {
-		shadow.version = src->version;
-		rmb();
-		shadow.tsc_timestamp     = src->tsc_timestamp;
-		shadow.system_timestamp  = src->system_time;
-		shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
-		shadow.tsc_shift         = src->tsc_shift;
-		rmb();
-	}
-	while ((src->version & 1) | (shadow.version ^ src->version));
-
-	shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
+    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
+
+    do {
+        shadow.version = src->version;
+        rmb();
+        shadow.tsc_timestamp     = src->tsc_timestamp;
+        shadow.system_timestamp  = src->system_time;
+        shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
+        shadow.tsc_shift         = src->tsc_shift;
+        rmb();
+    } while ( (src->version & 1) | (shadow.version ^ src->version) );
+
+    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
 }
 
-
-
-
-/* monotonic_clock(): returns # of nanoseconds passed since time_init()
- *		Note: This function is required to return accurate
- *		time even in the absence of multiple timer ticks.
+/*
+ * monotonic_clock(): returns # of nanoseconds passed since time_init()
+ *        Note: This function is required to return accurate
+ *        time even in the absence of multiple timer ticks.
  */
 uint64_t monotonic_clock(void)
 {
-	uint64_t time;
-	uint32_t local_time_version;
-
-	do {
-		local_time_version = shadow.version;
-		rmb();
-		time = shadow.system_timestamp + get_nsec_offset();
-		if (!time_values_up_to_date())
-			get_time_values_from_xen();
-		rmb();
-	} while (local_time_version != shadow.version);
-
-	return time;
+    uint64_t time;
+    uint32_t local_time_version;
+
+    do {
+        local_time_version = shadow.version;
+        rmb();
+        time = shadow.system_timestamp + get_nsec_offset();
+        if ( !time_values_up_to_date() )
+            get_time_values_from_xen();
+        rmb();
+    } while ( local_time_version != shadow.version );
+
+    return time;
 }
 
 static void update_wallclock(void)
 {
-	shared_info_t *s = HYPERVISOR_shared_info;
-
-	do {
-		shadow_ts_version = s->wc_version;
-		rmb();
-		shadow_ts.tv_sec  = s->wc_sec;
-		shadow_ts.tv_nsec = s->wc_nsec;
-		rmb();
-	}
-	while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version));
+    shared_info_t *s = HYPERVISOR_shared_info;
+
+    do {
+        shadow_ts_version = s->wc_version;
+        rmb();
+        shadow_ts.tv_sec  = s->wc_sec;
+        shadow_ts.tv_nsec = s->wc_nsec;
+        rmb();
+    } while ( (s->wc_version & 1) | (shadow_ts_version ^ s->wc_version) );
 }
 
-
 int gettimeofday(struct timeval *tv, void *tz)
 {
     uint64_t nsec = monotonic_clock();
 
-    if (!wc_values_up_to_date())
-	update_wallclock();
+    if ( !wc_values_up_to_date() )
+        update_wallclock();
 
     nsec += shadow_ts.tv_nsec;
 
@@ -209,7 +202,7 @@ EXPORT_SYMBOL(gettimeofday);
 void block_domain(s_time_t until)
 {
     ASSERT(irqs_disabled());
-    if(monotonic_clock() < until)
+    if ( monotonic_clock() < until )
     {
         HYPERVISOR_set_timer_op(until);
 #ifdef CONFIG_PARAVIRT
@@ -228,9 +221,8 @@ static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
     HYPERVISOR_set_timer_op(monotonic_clock() + MILLISECS(1));
 }
 
-
-
 static evtchn_port_t port;
+
 void init_time(void)
 {
     port = bind_virq(VIRQ_TIMER, &timer_handler, NULL);
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 12:17:00 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 12:17:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761815.1171873 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryO-0006Zd-NX; Mon, 22 Jul 2024 12:17:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761815.1171873; Mon, 22 Jul 2024 12:17:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryO-0006ZV-KZ; Mon, 22 Jul 2024 12:17:00 +0000
Received: by outflank-mailman (input) for mailman id 761815;
 Mon, 22 Jul 2024 12:16:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVryN-0005pO-EC
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 12:16:59 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b003585-4824-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 14:16:58 +0200 (CEST)
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 6B0851FB6A;
 Mon, 22 Jul 2024 12:16: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 39B69138A7;
 Mon, 22 Jul 2024 12:16: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 ZttyDLpNnmYiIQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 12:16:58 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b003585-4824-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650618; 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=Egb0SYtRB9pNdsEw7/uOObXIsq6lW6qyCeWg38yHfSM=;
	b=MKK4HPiHSnwTZdflIzMCKzOOigqb3aR4YLzBdUiM2OSEMdQfqzrPAojEY9yC6BXtF00kOd
	NT7vURriElgHqgD+SSumwxkqW3ur1rD01MRFkNRz8TlBTlyWh1/XUhuQVAea6cdgsXD+m1
	p9rqIuH0fA2DCB612moxIHZBansol4I=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=MKK4HPiH
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650618; 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=Egb0SYtRB9pNdsEw7/uOObXIsq6lW6qyCeWg38yHfSM=;
	b=MKK4HPiHSnwTZdflIzMCKzOOigqb3aR4YLzBdUiM2OSEMdQfqzrPAojEY9yC6BXtF00kOd
	NT7vURriElgHqgD+SSumwxkqW3ur1rD01MRFkNRz8TlBTlyWh1/XUhuQVAea6cdgsXD+m1
	p9rqIuH0fA2DCB612moxIHZBansol4I=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 2/3] mini-os: remove some not needed stuff from arch/x86/time.c
Date: Mon, 22 Jul 2024 14:16:42 +0200
Message-ID: <20240722121643.18116-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722121643.18116-1-jgross@suse.com>
References: <20240722121643.18116-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.81
X-Rspamd-Action: no action
X-Spam-Level: 
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 6B0851FB6A
X-Spamd-Result: default: False [-3.81 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	DWL_DNSWL_LOW(-1.00)[suse.com:dkim];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	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)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spam-Flag: NO

Remove unused or not needed stuff from arch/x86/time.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/time.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/arch/x86/time.c b/arch/x86/time.c
index a473a9e1..7fd7abef 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -48,7 +48,6 @@ struct shadow_time_info {
     uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
     uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
     uint32_t tsc_to_nsec_mul;
-    uint32_t tsc_to_usec_mul;
     int tsc_shift;
     uint32_t version;
 };
@@ -57,19 +56,6 @@ static uint32_t shadow_ts_version;
 
 static struct shadow_time_info shadow;
 
-#ifndef rmb
-#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
-#endif
-
-#define HANDLE_USEC_OVERFLOW(_tv)           \
-    do {                                    \
-        while ( (_tv)->tv_usec >= 1000000 ) \
-        {                                   \
-            (_tv)->tv_usec -= 1000000;      \
-            (_tv)->tv_sec++;                \
-        }                                   \
-    } while ( 0 )
-
 static inline int time_values_up_to_date(void)
 {
     struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
@@ -143,8 +129,6 @@ static void get_time_values_from_xen(void)
         shadow.tsc_shift         = src->tsc_shift;
         rmb();
     } while ( (src->version & 1) | (shadow.version ^ src->version) );
-
-    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
 }
 
 /*
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 12:17:08 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 12:17:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.761820.1171898 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryW-0007Lf-G1; Mon, 22 Jul 2024 12:17:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 761820.1171898; Mon, 22 Jul 2024 12:17:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVryW-0007LX-Bi; Mon, 22 Jul 2024 12:17:08 +0000
Received: by outflank-mailman (input) for mailman id 761820;
 Mon, 22 Jul 2024 12:17:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVryV-0005pO-6x
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 12:17:07 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4f112dc2-4824-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 14:17:05 +0200 (CEST)
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 0B7A921849;
 Mon, 22 Jul 2024 12:17: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 CF2B2138A7;
 Mon, 22 Jul 2024 12:17: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 txsdMb9NnmYtIQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 12:17:03 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f112dc2-4824-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650625; 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=vN1oYJgnKGXgHS+7WZJ4Q18USh1zc0tS4qvELPG//0g=;
	b=l6XNNSormHLDQBcjM97GIRBqTF/133nH+AlzKg2vtmDgbPPgW7gRbZvsyqJdqBOmZYdN9x
	qi82ljcj/E5XsQKv15B1S4EQ5cc3qZoMxJXazlsrIpnPD053XrNpB6twXWKE80MIlWI4QT
	oihsNOqNqs2ticUVAwyB2UUKuBgWehs=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=O3T7queS
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721650624; 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=vN1oYJgnKGXgHS+7WZJ4Q18USh1zc0tS4qvELPG//0g=;
	b=O3T7queSEzN2XVVxG1f++WZkkjdp+K9+jUCCfCabUE6kDkip/ZXjYjQh5jSWg1a/bKhNKh
	zqAvjlvq1Xv8SMmB50p1oYh/B9Wng2HGgaH9Q9rV7ICEaBCEyXi8JueZ/53kTXZ+1Vhbzg
	GtYNCJPoLBSYtEtQOv9i/UKLTmOQPRg=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 3/3] mini-os: simplify monotonic_clock()
Date: Mon, 22 Jul 2024 14:16:43 +0200
Message-ID: <20240722121643.18116-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722121643.18116-1-jgross@suse.com>
References: <20240722121643.18116-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.81
X-Rspamd-Action: no action
X-Spam-Level: 
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 0B7A921849
X-Spamd-Result: default: False [-3.81 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	DWL_DNSWL_LOW(-1.00)[suse.com:dkim];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	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:dkim,suse.com:email];
	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)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spam-Flag: NO

monotonic_clock() in arch/x86/time.c is more complex than needed: it
has basically two nested loops making sure the time data obtained from
Xen are valid.

Simplify that by merging some of the used sub-functions into the main
function and using only a single loop. Further simplify the code by
using struct vcpu_time_info for the local instance instead of defining
a similar structure in the code.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/time.c | 58 ++++++++++++++-----------------------------------
 1 file changed, 16 insertions(+), 42 deletions(-)

diff --git a/arch/x86/time.c b/arch/x86/time.c
index 7fd7abef..52916e15 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -44,24 +44,10 @@
  *************************************************************************/
 
 /* These are peridically updated in shared_info, and then copied here. */
-struct shadow_time_info {
-    uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
-    uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
-    uint32_t tsc_to_nsec_mul;
-    int tsc_shift;
-    uint32_t version;
-};
 static struct timespec shadow_ts;
 static uint32_t shadow_ts_version;
 
-static struct shadow_time_info shadow;
-
-static inline int time_values_up_to_date(void)
-{
-    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
-
-    return shadow.version == src->version;
-}
+static struct vcpu_time_info shadow;
 
 static inline int wc_values_up_to_date(void)
 {
@@ -113,22 +99,7 @@ static unsigned long get_nsec_offset(void)
     rdtscll(now);
     delta = now - shadow.tsc_timestamp;
 
-    return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
-}
-
-static void get_time_values_from_xen(void)
-{
-    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
-
-    do {
-        shadow.version = src->version;
-        rmb();
-        shadow.tsc_timestamp     = src->tsc_timestamp;
-        shadow.system_timestamp  = src->system_time;
-        shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
-        shadow.tsc_shift         = src->tsc_shift;
-        rmb();
-    } while ( (src->version & 1) | (shadow.version ^ src->version) );
+    return scale_delta(delta, shadow.tsc_to_system_mul, shadow.tsc_shift);
 }
 
 /*
@@ -138,19 +109,22 @@ static void get_time_values_from_xen(void)
  */
 uint64_t monotonic_clock(void)
 {
-    uint64_t time;
-    uint32_t local_time_version;
+    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
-    do {
-        local_time_version = shadow.version;
-        rmb();
-        time = shadow.system_timestamp + get_nsec_offset();
-        if ( !time_values_up_to_date() )
-            get_time_values_from_xen();
-        rmb();
-    } while ( local_time_version != shadow.version );
+    if ( shadow.version != src->version )
+    {
+        do {
+            shadow.version = src->version;
+            rmb();
+            shadow.tsc_timestamp     = src->tsc_timestamp;
+            shadow.system_time       = src->system_time;
+            shadow.tsc_to_system_mul = src->tsc_to_system_mul;
+            shadow.tsc_shift         = src->tsc_shift;
+            rmb();
+        } while ( (src->version & 1) || (shadow.version != src->version) );
+    }
 
-    return time;
+    return shadow.system_time + get_nsec_offset();
 }
 
 static void update_wallclock(void)
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:01:51 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:01:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762117.1172226 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuXt-0000bu-W2; Mon, 22 Jul 2024 15:01:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762117.1172226; Mon, 22 Jul 2024 15:01:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuXt-0000bn-Sr; Mon, 22 Jul 2024 15:01:49 +0000
Received: by outflank-mailman (input) for mailman id 762117;
 Mon, 22 Jul 2024 15:01:47 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVuXr-0000bJ-QC
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:01:47 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f6dea0a-483b-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 17:01:44 +0200 (CEST)
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 079111FB73;
 Mon, 22 Jul 2024 15:01:44 +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 BF621136A9;
 Mon, 22 Jul 2024 15:01:43 +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 gC05LVd0nmaFVgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:01:43 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f6dea0a-483b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660504; 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=8w2yj4tCoress7M4+t/E8kv6ccuo2Mv5ulBvjkeIp0o=;
	b=GlaVkVSednbL7HCSgkwFpoMPVG2c8InCkdzoLOgNKqOuTsSKH8jXlvmJphrYvaadSgBkBn
	nasSPcYGWZhE+zp44QKAUyMdzGLNZJDNr016LNAhcjwMa+ViJeJ5TJR4DywTY8EXiSkjEP
	Myg9Kg7m+EDJHlfmDXKgE4yYJoQ8rIM=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=GlaVkVSe
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660504; 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=8w2yj4tCoress7M4+t/E8kv6ccuo2Mv5ulBvjkeIp0o=;
	b=GlaVkVSednbL7HCSgkwFpoMPVG2c8InCkdzoLOgNKqOuTsSKH8jXlvmJphrYvaadSgBkBn
	nasSPcYGWZhE+zp44QKAUyMdzGLNZJDNr016LNAhcjwMa+ViJeJ5TJR4DywTY8EXiSkjEP
	Myg9Kg7m+EDJHlfmDXKgE4yYJoQ8rIM=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 0/4] mini-os: cleanup of mm.c
Date: Mon, 22 Jul 2024 17:01:37 +0200
Message-ID: <20240722150141.31391-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [0.19 / 50.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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]
X-Spam-Level: 
X-Rspamd-Queue-Id: 079111FB73
X-Spam-Score: 0.19
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Bar: /

Some cleanups in mm.c: style, removal of unused stuff, optimizations.

Juergen Gross (4):
  mini-os: make mm.c coding style compliant
  mini-os: mm: remove not needed struct chunk_tail_st
  mini-os: mm: reduce buddy allocator list administration data
  mini-os: remove sanity_check()

 include/lib.h |   3 -
 mm.c          | 264 +++++++++++++++++++++-----------------------------
 2 files changed, 112 insertions(+), 155 deletions(-)

-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:01:54 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762120.1172250 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuXy-000199-Kd; Mon, 22 Jul 2024 15:01:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762120.1172250; Mon, 22 Jul 2024 15:01:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuXy-000190-H0; Mon, 22 Jul 2024 15:01:54 +0000
Received: by outflank-mailman (input) for mailman id 762120;
 Mon, 22 Jul 2024 15:01:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVuXx-0000sY-1W
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:01:53 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de
 [2a07:de40:b251:101:10:150:64:1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 532cd5e6-483b-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 17:01:51 +0200 (CEST)
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 5373821B50;
 Mon, 22 Jul 2024 15:01: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 1698E136A9;
 Mon, 22 Jul 2024 15:01: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 XqT0A150nmaSVgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:01:50 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 532cd5e6-483b-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660510; 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=YnDqWS+vxb+tfdScCZ+zPNB/CgAS3SnGjXk0zuPrX8E=;
	b=NedBZ65pGT+BdBneGVcYkoRtDL35kkNcZjeyPENo05SsJfWY/IeFce7stwaG2+S9j4gB4c
	vZ2lk0/A8o2bsnOCryrwvFfPdP/l47tb4cZJs181rvGGA+TnStb4TmWbthMmPLyFFZYM1k
	5fp3gSx8S2PYzmZaa6Er8mlS+BVx72I=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=NedBZ65p
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660510; 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=YnDqWS+vxb+tfdScCZ+zPNB/CgAS3SnGjXk0zuPrX8E=;
	b=NedBZ65pGT+BdBneGVcYkoRtDL35kkNcZjeyPENo05SsJfWY/IeFce7stwaG2+S9j4gB4c
	vZ2lk0/A8o2bsnOCryrwvFfPdP/l47tb4cZJs181rvGGA+TnStb4TmWbthMmPLyFFZYM1k
	5fp3gSx8S2PYzmZaa6Er8mlS+BVx72I=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 1/4] mini-os: make mm.c coding style compliant
Date: Mon, 22 Jul 2024 17:01:38 +0200
Message-ID: <20240722150141.31391-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722150141.31391-1-jgross@suse.com>
References: <20240722150141.31391-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.81
X-Rspamd-Action: no action
X-Spam-Level: 
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 5373821B50
X-Spamd-Result: default: False [-2.81 / 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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	FROM_HAS_DN(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]
X-Spam-Flag: NO

Apply the coding style to mm.c.

No functional change.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 mm.c | 191 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 95 deletions(-)

diff --git a/mm.c b/mm.c
index eb0e34de..1dcd954c 100644
--- a/mm.c
+++ b/mm.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
@@ -7,9 +7,9 @@
  *        File: mm.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos
- *              
+ *
  *        Date: Aug 2003, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: memory management related functions
  *              contains buddy page allocator from Xen.
@@ -21,16 +21,16 @@
  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  * sell copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
@@ -45,7 +45,7 @@
 #include <mini-os/xmalloc.h>
 #include <mini-os/e820.h>
 
-/*********************
+/*
  * ALLOCATION BITMAP
  *  One bit per page of memory. Bit set => page is allocated.
  */
@@ -55,7 +55,7 @@ unsigned long mm_alloc_bitmap_size;
 
 #define PAGES_PER_MAPWORD (sizeof(unsigned long) * 8)
 
-#define allocated_in_map(_pn) \
+#define allocated_in_map(_pn)                     \
     (mm_alloc_bitmap[(_pn) / PAGES_PER_MAPWORD] & \
      (1UL << ((_pn) & (PAGES_PER_MAPWORD - 1))))
 
@@ -63,8 +63,8 @@ unsigned long nr_free_pages;
 
 /*
  * Hint regarding bitwise arithmetic in map_{alloc,free}:
- *  -(1<<n)  sets all bits >= n. 
- *  (1<<n)-1 sets all bits <  n.
+ *  -(1 << n)  sets all bits >= n.
+ *  (1 << n) - 1 sets all bits <  n.
  * Variable names in map_{alloc,free}:
  *  *_idx == Index into `mm_alloc_bitmap' array.
  *  *_off == Bit offset within an element of the `mm_alloc_bitmap' array.
@@ -75,53 +75,52 @@ static void map_alloc(unsigned long first_page, unsigned long nr_pages)
     unsigned long start_off, end_off, curr_idx, end_idx;
 
     curr_idx  = first_page / PAGES_PER_MAPWORD;
-    start_off = first_page & (PAGES_PER_MAPWORD-1);
+    start_off = first_page & (PAGES_PER_MAPWORD - 1);
     end_idx   = (first_page + nr_pages) / PAGES_PER_MAPWORD;
-    end_off   = (first_page + nr_pages) & (PAGES_PER_MAPWORD-1);
+    end_off   = (first_page + nr_pages) & (PAGES_PER_MAPWORD - 1);
 
     if ( curr_idx == end_idx )
     {
-        mm_alloc_bitmap[curr_idx] |= ((1UL<<end_off)-1) & -(1UL<<start_off);
+        mm_alloc_bitmap[curr_idx] |= ((1UL << end_off) - 1) &
+                                     -(1UL << start_off);
     }
-    else 
+    else
     {
-        mm_alloc_bitmap[curr_idx] |= -(1UL<<start_off);
-        while ( ++curr_idx < end_idx ) mm_alloc_bitmap[curr_idx] = ~0UL;
-        mm_alloc_bitmap[curr_idx] |= (1UL<<end_off)-1;
+        mm_alloc_bitmap[curr_idx] |= -(1UL << start_off);
+        while ( ++curr_idx < end_idx )
+            mm_alloc_bitmap[curr_idx] = ~0UL;
+        mm_alloc_bitmap[curr_idx] |= (1UL << end_off) - 1;
     }
 
     nr_free_pages -= nr_pages;
 }
 
-
 static void map_free(unsigned long first_page, unsigned long nr_pages)
 {
     unsigned long start_off, end_off, curr_idx, end_idx;
 
     curr_idx = first_page / PAGES_PER_MAPWORD;
-    start_off = first_page & (PAGES_PER_MAPWORD-1);
+    start_off = first_page & (PAGES_PER_MAPWORD - 1);
     end_idx   = (first_page + nr_pages) / PAGES_PER_MAPWORD;
-    end_off   = (first_page + nr_pages) & (PAGES_PER_MAPWORD-1);
+    end_off   = (first_page + nr_pages) & (PAGES_PER_MAPWORD - 1);
 
     nr_free_pages += nr_pages;
 
     if ( curr_idx == end_idx )
     {
-        mm_alloc_bitmap[curr_idx] &= -(1UL<<end_off) | ((1UL<<start_off)-1);
+        mm_alloc_bitmap[curr_idx] &= -(1UL << end_off) |
+                                     ((1UL << start_off) - 1);
     }
-    else 
+    else
     {
-        mm_alloc_bitmap[curr_idx] &= (1UL<<start_off)-1;
-        while ( ++curr_idx != end_idx ) mm_alloc_bitmap[curr_idx] = 0;
-        mm_alloc_bitmap[curr_idx] &= -(1UL<<end_off);
+        mm_alloc_bitmap[curr_idx] &= (1UL << start_off) - 1;
+        while ( ++curr_idx != end_idx )
+            mm_alloc_bitmap[curr_idx] = 0;
+        mm_alloc_bitmap[curr_idx] &= -(1UL << end_off);
     }
 }
 
-
-
-/*************************
- * BINARY BUDDY ALLOCATOR
- */
+/* BINARY BUDDY ALLOCATOR */
 
 typedef struct chunk_head_st chunk_head_t;
 typedef struct chunk_tail_st chunk_tail_t;
@@ -137,7 +136,7 @@ struct chunk_tail_st {
 };
 
 /* Linked lists of free chunks of different powers-of-two in size. */
-#define FREELIST_SIZE ((sizeof(void*)<<3)-PAGE_SHIFT)
+#define FREELIST_SIZE ((sizeof(void *) << 3) - PAGE_SHIFT)
 static chunk_head_t *free_head[FREELIST_SIZE];
 static chunk_head_t  free_tail[FREELIST_SIZE];
 #define FREELIST_EMPTY(_l) ((_l)->next == NULL)
@@ -163,14 +162,14 @@ static void init_page_allocator(unsigned long min, unsigned long max)
         free_tail[i].next  = NULL;
     }
 
-    min = round_pgup  (min);
+    min = round_pgup(min);
     max = round_pgdown(max);
 
     /* Allocate space for the allocation bitmap. */
-    mm_alloc_bitmap_size  = (max + 1) >> (PAGE_SHIFT + 3);
-    mm_alloc_bitmap_size  = round_pgup(mm_alloc_bitmap_size);
+    mm_alloc_bitmap_size = (max + 1) >> (PAGE_SHIFT + 3);
+    mm_alloc_bitmap_size = round_pgup(mm_alloc_bitmap_size);
     mm_alloc_bitmap = (unsigned long *)to_virt(min);
-    min         += mm_alloc_bitmap_size;
+    min += mm_alloc_bitmap_size;
 
     /* All allocated by default. */
     memset(mm_alloc_bitmap, ~0, mm_alloc_bitmap_size);
@@ -208,7 +207,10 @@ static void init_page_allocator(unsigned long min, unsigned long max)
              * must not be bigger than remaining range.
              */
             for ( i = PAGE_SHIFT; (1UL << (i + 1)) <= range; i++ )
-                if ( r_min & (1UL << i) ) break;
+            {
+                if ( r_min & (1UL << i) )
+                    break;
+            }
 
             ch = (chunk_head_t *)r_min;
             r_min += 1UL << i;
@@ -227,7 +229,6 @@ static void init_page_allocator(unsigned long min, unsigned long max)
     mm_alloc_bitmap_remap();
 }
 
-
 /* Allocate 2^@order contiguous pages. Returns a VIRTUAL address. */
 unsigned long alloc_pages(int order)
 {
@@ -239,13 +240,15 @@ unsigned long alloc_pages(int order)
         goto no_memory;
 
     /* Find smallest order which can satisfy the request. */
-    for ( i = order; i < FREELIST_SIZE; i++ ) {
-	if ( !FREELIST_EMPTY(free_head[i]) ) 
-	    break;
+    for ( i = order; i < FREELIST_SIZE; i++ )
+    {
+        if ( !FREELIST_EMPTY(free_head[i]) )
+            break;
     }
 
-    if ( i == FREELIST_SIZE ) goto no_memory;
- 
+    if ( i == FREELIST_SIZE )
+        goto no_memory;
+
     /* Unlink a chunk. */
     alloc_ch = free_head[i];
     free_head[i] = alloc_ch->next;
@@ -256,8 +259,10 @@ unsigned long alloc_pages(int order)
     {
         /* Split into two equal parts. */
         i--;
-        spare_ch = (chunk_head_t *)((char *)alloc_ch + (1UL<<(i+PAGE_SHIFT)));
-        spare_ct = (chunk_tail_t *)((char *)spare_ch + (1UL<<(i+PAGE_SHIFT)))-1;
+        spare_ch = (chunk_head_t *)((char *)alloc_ch +
+                                    (1UL << (i + PAGE_SHIFT)));
+        spare_ct = (chunk_tail_t *)((char *)spare_ch +
+                                    (1UL << (i + PAGE_SHIFT))) - 1;
 
         /* Create new header for spare chunk. */
         spare_ch->level = i;
@@ -269,13 +274,12 @@ unsigned long alloc_pages(int order)
         spare_ch->next->pprev = &spare_ch->next;
         free_head[i] = spare_ch;
     }
-    
-    map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL<<order);
 
-    return((unsigned long)alloc_ch);
+    map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL << order);
 
- no_memory:
+    return (unsigned long)alloc_ch;
 
+ no_memory:
     printk("Cannot handle page request order %d!\n", order);
 
     return 0;
@@ -287,43 +291,44 @@ void free_pages(void *pointer, int order)
     chunk_head_t *freed_ch, *to_merge_ch;
     chunk_tail_t *freed_ct;
     unsigned long mask;
-    
+
     /* First free the chunk */
     map_free(virt_to_pfn(pointer), 1UL << order);
-    
+
     /* Create free chunk */
     freed_ch = (chunk_head_t *)pointer;
-    freed_ct = (chunk_tail_t *)((char *)pointer + (1UL<<(order + PAGE_SHIFT)))-1;
-    
+    freed_ct = (chunk_tail_t *)((char *)pointer +
+                                (1UL << (order + PAGE_SHIFT))) - 1;
+
     /* Now, possibly we can conseal chunks together */
-    while(order < FREELIST_SIZE)
+    while ( order < FREELIST_SIZE )
     {
         mask = 1UL << (order + PAGE_SHIFT);
-        if((unsigned long)freed_ch & mask) 
+        if ( (unsigned long)freed_ch & mask )
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch - mask);
-            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
-                    to_merge_ch->level != order)
+            if ( allocated_in_map(virt_to_pfn(to_merge_ch)) ||
+                 to_merge_ch->level != order )
                 break;
-            
+
             /* Merge with predecessor */
-            freed_ch = to_merge_ch;   
+            freed_ch = to_merge_ch;
         }
-        else 
+        else
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch + mask);
-            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
-                    to_merge_ch->level != order)
+            if ( allocated_in_map(virt_to_pfn(to_merge_ch)) ||
+                 to_merge_ch->level != order )
                 break;
-            
+
             /* Merge with successor */
             freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask) - 1;
         }
-        
-        /* We are commited to merging, unlink the chunk */
+
+        /* We are committed to merging, unlink the chunk */
         *(to_merge_ch->pprev) = to_merge_ch->next;
         to_merge_ch->next->pprev = to_merge_ch->pprev;
-        
+
         order++;
     }
 
@@ -332,10 +337,10 @@ void free_pages(void *pointer, int order)
     freed_ch->next  = free_head[order];
     freed_ch->pprev = &free_head[order];
     freed_ct->level = order;
-    
+
     freed_ch->next->pprev = &freed_ch->next;
-    free_head[order] = freed_ch;   
-   
+    free_head[order] = freed_ch;
+
 }
 EXPORT_SYMBOL(free_pages);
 
@@ -347,6 +352,7 @@ int free_physical_pages(xen_pfn_t *mfns, int n)
     reservation.nr_extents = n;
     reservation.extent_order = 0;
     reservation.domid = DOMID_SELF;
+
     return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
 }
 
@@ -362,16 +368,15 @@ void *sbrk(ptrdiff_t increment)
     unsigned long old_brk = brk;
     unsigned long new_brk = old_brk + increment;
 
-    if (new_brk > heap_end) {
-	printk("Heap exhausted: %lx + %lx = %p > %p\n",
-			old_brk,
-			(unsigned long) increment,
-			(void *) new_brk,
-			(void *) heap_end);
-	return NULL;
+    if ( new_brk > heap_end )
+    {
+        printk("Heap exhausted: %lx + %lx = %p > %p\n", old_brk,
+               (unsigned long) increment, (void *)new_brk, (void *)heap_end);
+        return NULL;
     }
-    
-    if (new_brk > heap_mapped) {
+
+    if ( new_brk > heap_mapped )
+    {
         unsigned long n = (new_brk - heap_mapped + PAGE_SIZE - 1) / PAGE_SIZE;
 
         if ( !chk_free_pages(n) )
@@ -386,16 +391,13 @@ void *sbrk(ptrdiff_t increment)
 
     brk = new_brk;
 
-    return (void *) old_brk;
+    return (void *)old_brk;
 }
 EXPORT_SYMBOL(sbrk);
 #endif
 
-
-
 void init_mm(void)
 {
-
     unsigned long start_pfn, max_pfn;
 
     printk("MM: Init\n");
@@ -403,14 +405,12 @@ void init_mm(void)
     arch_init_mm(&start_pfn, &max_pfn);
     get_max_pages();
 
-    /*
-     * now we can initialise the page allocator
-     */
+    /* Now we can initialise the page allocator. */
     init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn));
     printk("MM: done\n");
 
     arch_init_p2m(max_pfn);
-    
+
     arch_init_demand_mapping_area();
 }
 
@@ -423,14 +423,15 @@ void sanity_check(void)
     int x;
     chunk_head_t *head;
 
-    for (x = 0; x < FREELIST_SIZE; x++) {
-        for (head = free_head[x]; !FREELIST_EMPTY(head); head = head->next) {
+    for ( x = 0; x < FREELIST_SIZE; x++ )
+    {
+        for ( head = free_head[x]; !FREELIST_EMPTY(head); head = head->next )
+        {
             ASSERT(!allocated_in_map(virt_to_pfn(head)));
-            if (head->next)
+            if ( head->next )
                 ASSERT(head->next->pprev == &head->next);
         }
-        if (free_head[x]) {
+        if ( free_head[x] )
             ASSERT(free_head[x]->pprev == &free_head[x]);
-        }
     }
 }
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:01:57 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:01:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762121.1172254 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuY1-0001Dw-MU; Mon, 22 Jul 2024 15:01:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762121.1172254; Mon, 22 Jul 2024 15:01:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuY1-0001Dl-J1; Mon, 22 Jul 2024 15:01:57 +0000
Received: by outflank-mailman (input) for mailman id 762121;
 Mon, 22 Jul 2024 15:01:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVuY0-0000sY-RM
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:01:56 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 56594ce2-483b-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 17:01:56 +0200 (CEST)
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 DE9B521B50;
 Mon, 22 Jul 2024 15:01:55 +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 AE64F136A9;
 Mon, 22 Jul 2024 15:01: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 L4IbKWN0nmabVgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:01:55 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56594ce2-483b-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660515; 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=nksZ0M2mk6k6WRsqSkuDpYdF4fiT+vkR2yJNQYWtE/8=;
	b=YREmH+Mn5wP1P6us2hwl6Rp6fdztSzc10p1q2IUVtZY0LxLw2v08cEuVdkBjyHZbK1+0Xc
	htgyQbjr7A2Lcv9yZfZ+g3K7xk54yrMjFe3CSdJWwiz4X2uvssS83tqEwoMj8AvAU7Zj8y
	+1cCCf5dYaW2JtSSa7QMfhb5vkNvQLw=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660515; 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=nksZ0M2mk6k6WRsqSkuDpYdF4fiT+vkR2yJNQYWtE/8=;
	b=YREmH+Mn5wP1P6us2hwl6Rp6fdztSzc10p1q2IUVtZY0LxLw2v08cEuVdkBjyHZbK1+0Xc
	htgyQbjr7A2Lcv9yZfZ+g3K7xk54yrMjFe3CSdJWwiz4X2uvssS83tqEwoMj8AvAU7Zj8y
	+1cCCf5dYaW2JtSSa7QMfhb5vkNvQLw=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 2/4] mini-os: mm: remove not needed struct chunk_tail_st
Date: Mon, 22 Jul 2024 17:01:39 +0200
Message-ID: <20240722150141.31391-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722150141.31391-1-jgross@suse.com>
References: <20240722150141.31391-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.60
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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)[suse.com:email];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO

The struct chunk_tail_st isn't really used other than writing to it.

Remove it in order to simplify the code.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 mm.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/mm.c b/mm.c
index 1dcd954c..2cc49e94 100644
--- a/mm.c
+++ b/mm.c
@@ -123,7 +123,6 @@ static void map_free(unsigned long first_page, unsigned long nr_pages)
 /* BINARY BUDDY ALLOCATOR */
 
 typedef struct chunk_head_st chunk_head_t;
-typedef struct chunk_tail_st chunk_tail_t;
 
 struct chunk_head_st {
     chunk_head_t  *next;
@@ -131,10 +130,6 @@ struct chunk_head_st {
     int            level;
 };
 
-struct chunk_tail_st {
-    int level;
-};
-
 /* Linked lists of free chunks of different powers-of-two in size. */
 #define FREELIST_SIZE ((sizeof(void *) << 3) - PAGE_SHIFT)
 static chunk_head_t *free_head[FREELIST_SIZE];
@@ -151,7 +146,6 @@ static void init_page_allocator(unsigned long min, unsigned long max)
     unsigned long range;
     unsigned long r_min, r_max;
     chunk_head_t *ch;
-    chunk_tail_t *ct;
 
     printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
            (u_long)to_virt(min), min, (u_long)to_virt(max), max);
@@ -215,14 +209,12 @@ static void init_page_allocator(unsigned long min, unsigned long max)
             ch = (chunk_head_t *)r_min;
             r_min += 1UL << i;
             range -= 1UL << i;
-            ct = (chunk_tail_t *)r_min - 1;
             i -= PAGE_SHIFT;
             ch->level       = i;
             ch->next        = free_head[i];
             ch->pprev       = &free_head[i];
             ch->next->pprev = &ch->next;
             free_head[i]    = ch;
-            ct->level       = i;
         }
     }
 
@@ -234,7 +226,6 @@ unsigned long alloc_pages(int order)
 {
     int i;
     chunk_head_t *alloc_ch, *spare_ch;
-    chunk_tail_t            *spare_ct;
 
     if ( !chk_free_pages(1UL << order) )
         goto no_memory;
@@ -261,14 +252,11 @@ unsigned long alloc_pages(int order)
         i--;
         spare_ch = (chunk_head_t *)((char *)alloc_ch +
                                     (1UL << (i + PAGE_SHIFT)));
-        spare_ct = (chunk_tail_t *)((char *)spare_ch +
-                                    (1UL << (i + PAGE_SHIFT))) - 1;
 
         /* Create new header for spare chunk. */
         spare_ch->level = i;
         spare_ch->next  = free_head[i];
         spare_ch->pprev = &free_head[i];
-        spare_ct->level = i;
 
         /* Link in the spare chunk. */
         spare_ch->next->pprev = &spare_ch->next;
@@ -289,7 +277,6 @@ EXPORT_SYMBOL(alloc_pages);
 void free_pages(void *pointer, int order)
 {
     chunk_head_t *freed_ch, *to_merge_ch;
-    chunk_tail_t *freed_ct;
     unsigned long mask;
 
     /* First free the chunk */
@@ -297,8 +284,6 @@ void free_pages(void *pointer, int order)
 
     /* Create free chunk */
     freed_ch = (chunk_head_t *)pointer;
-    freed_ct = (chunk_tail_t *)((char *)pointer +
-                                (1UL << (order + PAGE_SHIFT))) - 1;
 
     /* Now, possibly we can conseal chunks together */
     while ( order < FREELIST_SIZE )
@@ -320,9 +305,6 @@ void free_pages(void *pointer, int order)
             if ( allocated_in_map(virt_to_pfn(to_merge_ch)) ||
                  to_merge_ch->level != order )
                 break;
-
-            /* Merge with successor */
-            freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask) - 1;
         }
 
         /* We are committed to merging, unlink the chunk */
@@ -336,8 +318,6 @@ void free_pages(void *pointer, int order)
     freed_ch->level = order;
     freed_ch->next  = free_head[order];
     freed_ch->pprev = &free_head[order];
-    freed_ct->level = order;
-
     freed_ch->next->pprev = &freed_ch->next;
     free_head[order] = freed_ch;
 
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:02:04 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:02:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762125.1172268 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuY8-0001dR-1p; Mon, 22 Jul 2024 15:02:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762125.1172268; Mon, 22 Jul 2024 15:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuY7-0001dG-Uf; Mon, 22 Jul 2024 15:02:03 +0000
Received: by outflank-mailman (input) for mailman id 762125;
 Mon, 22 Jul 2024 15:02:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVuY6-0000sY-G0
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:02:02 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59b144a6-483b-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 17:02:01 +0200 (CEST)
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 8016921B50;
 Mon, 22 Jul 2024 15:02: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 4DFA5136A9;
 Mon, 22 Jul 2024 15:02: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 l4l4EWl0nmajVgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:02:01 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59b144a6-483b-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660521; 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=Cqa/twmVM9OR6b9NQWSPmCXSs3PkuPb764GnljYHV8Y=;
	b=OgKluMJAjn+x1h2p8rX38BpdneRC1u+uocS+PBb45If28Gmu2OgYySS68q9x/Xs8eipk/F
	RAUunhH3THxVgBjhRzZ+ncLfszj36N0Zq43lzmHZzJMeGyRy/13uIZtaGFm3/sOGebB5+V
	T+iUSFoPh6ek1YEuCskFxxpVY61Dh9o=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660521; 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=Cqa/twmVM9OR6b9NQWSPmCXSs3PkuPb764GnljYHV8Y=;
	b=OgKluMJAjn+x1h2p8rX38BpdneRC1u+uocS+PBb45If28Gmu2OgYySS68q9x/Xs8eipk/F
	RAUunhH3THxVgBjhRzZ+ncLfszj36N0Zq43lzmHZzJMeGyRy/13uIZtaGFm3/sOGebB5+V
	T+iUSFoPh6ek1YEuCskFxxpVY61Dh9o=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 3/4] mini-os: mm: reduce buddy allocator list administration data
Date: Mon, 22 Jul 2024 17:01:40 +0200
Message-ID: <20240722150141.31391-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722150141.31391-1-jgross@suse.com>
References: <20240722150141.31391-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.60
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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)[suse.com:email];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO

Today the administration data for the buddy allocator's lists consists
of 2 arrays: one pointer array and one list element array for easier
handling of the lists' tails.

Those arrays can be combined into one by dropping the pointer array and
using a different list end indicator.

Add enqueue and dequeue helpers for better readability.

Change the level member type to unsigned int.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 mm.c | 73 ++++++++++++++++++++++++++++--------------------------------
 1 file changed, 34 insertions(+), 39 deletions(-)

diff --git a/mm.c b/mm.c
index 2cc49e94..96686a5c 100644
--- a/mm.c
+++ b/mm.c
@@ -125,16 +125,30 @@ static void map_free(unsigned long first_page, unsigned long nr_pages)
 typedef struct chunk_head_st chunk_head_t;
 
 struct chunk_head_st {
-    chunk_head_t  *next;
-    chunk_head_t **pprev;
-    int            level;
+    chunk_head_t *next;
+    chunk_head_t *prev;
+    unsigned int  level;
 };
 
 /* Linked lists of free chunks of different powers-of-two in size. */
 #define FREELIST_SIZE ((sizeof(void *) << 3) - PAGE_SHIFT)
-static chunk_head_t *free_head[FREELIST_SIZE];
-static chunk_head_t  free_tail[FREELIST_SIZE];
-#define FREELIST_EMPTY(_l) ((_l)->next == NULL)
+static chunk_head_t  free_list[FREELIST_SIZE];
+#define FREELIST_EMPTY(_l) ((_l)->level == FREELIST_SIZE)
+
+static void enqueue_elem(chunk_head_t *elem, unsigned int level)
+{
+    elem->level = level;
+    elem->next = free_list[level].next;
+    elem->prev = &free_list[level];
+    elem->next->prev = elem;
+    free_list[level].next = elem;
+}
+
+static void dequeue_elem(chunk_head_t *elem)
+{
+    elem->prev->next = elem->next;
+    elem->next->prev = elem->prev;
+}
 
 /*
  * Initialise allocator, placing addresses [@min,@max] in free pool.
@@ -151,9 +165,9 @@ static void init_page_allocator(unsigned long min, unsigned long max)
            (u_long)to_virt(min), min, (u_long)to_virt(max), max);
     for ( i = 0; i < FREELIST_SIZE; i++ )
     {
-        free_head[i]       = &free_tail[i];
-        free_tail[i].pprev = &free_head[i];
-        free_tail[i].next  = NULL;
+        free_list[i].next  = &free_list[i];
+        free_list[i].prev  = &free_list[i];
+        free_list[i].level = FREELIST_SIZE;
     }
 
     min = round_pgup(min);
@@ -209,12 +223,7 @@ static void init_page_allocator(unsigned long min, unsigned long max)
             ch = (chunk_head_t *)r_min;
             r_min += 1UL << i;
             range -= 1UL << i;
-            i -= PAGE_SHIFT;
-            ch->level       = i;
-            ch->next        = free_head[i];
-            ch->pprev       = &free_head[i];
-            ch->next->pprev = &ch->next;
-            free_head[i]    = ch;
+            enqueue_elem(ch, i - PAGE_SHIFT);
         }
     }
 
@@ -233,17 +242,16 @@ unsigned long alloc_pages(int order)
     /* Find smallest order which can satisfy the request. */
     for ( i = order; i < FREELIST_SIZE; i++ )
     {
-        if ( !FREELIST_EMPTY(free_head[i]) )
+        if ( !FREELIST_EMPTY(free_list[i].next) )
             break;
     }
 
-    if ( i == FREELIST_SIZE )
+    if ( i >= FREELIST_SIZE )
         goto no_memory;
 
     /* Unlink a chunk. */
-    alloc_ch = free_head[i];
-    free_head[i] = alloc_ch->next;
-    alloc_ch->next->pprev = alloc_ch->pprev;
+    alloc_ch = free_list[i].next;
+    dequeue_elem(alloc_ch);
 
     /* We may have to break the chunk a number of times. */
     while ( i != order )
@@ -254,13 +262,7 @@ unsigned long alloc_pages(int order)
                                     (1UL << (i + PAGE_SHIFT)));
 
         /* Create new header for spare chunk. */
-        spare_ch->level = i;
-        spare_ch->next  = free_head[i];
-        spare_ch->pprev = &free_head[i];
-
-        /* Link in the spare chunk. */
-        spare_ch->next->pprev = &spare_ch->next;
-        free_head[i] = spare_ch;
+        enqueue_elem(spare_ch, i);
     }
 
     map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL << order);
@@ -308,18 +310,13 @@ void free_pages(void *pointer, int order)
         }
 
         /* We are committed to merging, unlink the chunk */
-        *(to_merge_ch->pprev) = to_merge_ch->next;
-        to_merge_ch->next->pprev = to_merge_ch->pprev;
+        dequeue_elem(to_merge_ch);
 
         order++;
     }
 
     /* Link the new chunk */
-    freed_ch->level = order;
-    freed_ch->next  = free_head[order];
-    freed_ch->pprev = &free_head[order];
-    freed_ch->next->pprev = &freed_ch->next;
-    free_head[order] = freed_ch;
+    enqueue_elem(freed_ch, order);
 
 }
 EXPORT_SYMBOL(free_pages);
@@ -405,13 +402,11 @@ void sanity_check(void)
 
     for ( x = 0; x < FREELIST_SIZE; x++ )
     {
-        for ( head = free_head[x]; !FREELIST_EMPTY(head); head = head->next )
+        for ( head = free_list[x].next; !FREELIST_EMPTY(head);
+              head = head->next )
         {
             ASSERT(!allocated_in_map(virt_to_pfn(head)));
-            if ( head->next )
-                ASSERT(head->next->pprev == &head->next);
+            ASSERT(head->next->prev == head);
         }
-        if ( free_head[x] )
-            ASSERT(free_head[x]->pprev == &free_head[x]);
     }
 }
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:02:13 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:02:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762136.1172292 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuYH-0002V1-Li; Mon, 22 Jul 2024 15:02:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762136.1172292; Mon, 22 Jul 2024 15:02:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVuYH-0002UN-Hz; Mon, 22 Jul 2024 15:02:13 +0000
Received: by outflank-mailman (input) for mailman id 762136;
 Mon, 22 Jul 2024 15:02:12 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVuYG-0000bJ-IE
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:02:12 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5d11f637-483b-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 17:02:07 +0200 (CEST)
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 201B01FB73;
 Mon, 22 Jul 2024 15:02: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 E1AD3136A9;
 Mon, 22 Jul 2024 15:02:06 +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 9I+bNW50nmaqVgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:02:06 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d11f637-483b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660527; 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=mS1uWPpdCrC7UXHpXbDcoLGvGKv0oO3EBtOjFDnnTtg=;
	b=uW3yZTksYT8ntBDAceHfaSh/P+deWpsM2FkhzyvTtMVkDekj5nwwhwV+T0TegTJfNv67V3
	HRPzHxqKxdVqgmtEjIM+JRjBFh3tQ2chhM5IcSYiw1UvBGVdVqTi7qhkBgVe8TxfJiTxp6
	BbOxdhmFsaevYvsMIzv7c0DLaZ1x0wI=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=uW3yZTks
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660527; 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=mS1uWPpdCrC7UXHpXbDcoLGvGKv0oO3EBtOjFDnnTtg=;
	b=uW3yZTksYT8ntBDAceHfaSh/P+deWpsM2FkhzyvTtMVkDekj5nwwhwV+T0TegTJfNv67V3
	HRPzHxqKxdVqgmtEjIM+JRjBFh3tQ2chhM5IcSYiw1UvBGVdVqTi7qhkBgVe8TxfJiTxp6
	BbOxdhmFsaevYvsMIzv7c0DLaZ1x0wI=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 4/4] mini-os: remove sanity_check()
Date: Mon, 22 Jul 2024 17:01:41 +0200
Message-ID: <20240722150141.31391-5-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240722150141.31391-1-jgross@suse.com>
References: <20240722150141.31391-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.81
X-Rspamd-Action: no action
X-Spam-Level: 
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 201B01FB73
X-Spamd-Result: default: False [-2.81 / 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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	FROM_HAS_DN(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]
X-Spam-Flag: NO

Remove the sanity_check() function, as it is used nowhere.

Since any application linked with Mini-OS can't call sanity_check()
either (there is no EXPORT_SYMBOL for it), there is zero chance of
breaking any use case.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 include/lib.h |  3 ---
 mm.c          | 16 ----------------
 2 files changed, 19 deletions(-)

diff --git a/include/lib.h b/include/lib.h
index abd4e9ab..acd4acc6 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -152,9 +152,6 @@ do {                                                           \
 
 #define BUG_ON(x) ASSERT(!(x))
 
-/* Consistency check as much as possible. */
-void sanity_check(void);
-
 /* Get own domid. */
 domid_t get_domid(void);
 
diff --git a/mm.c b/mm.c
index 96686a5c..1fa7e7bf 100644
--- a/mm.c
+++ b/mm.c
@@ -394,19 +394,3 @@ void init_mm(void)
 void fini_mm(void)
 {
 }
-
-void sanity_check(void)
-{
-    int x;
-    chunk_head_t *head;
-
-    for ( x = 0; x < FREELIST_SIZE; x++ )
-    {
-        for ( head = free_list[x].next; !FREELIST_EMPTY(head);
-              head = head->next )
-        {
-            ASSERT(!allocated_in_map(virt_to_pfn(head)));
-            ASSERT(head->next->prev == head);
-        }
-    }
-}
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 15:08:52 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 15:08:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762183.1172301 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVueh-0004ZW-62; Mon, 22 Jul 2024 15:08:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762183.1172301; Mon, 22 Jul 2024 15:08:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sVueh-0004ZP-3Y; Mon, 22 Jul 2024 15:08:51 +0000
Received: by outflank-mailman (input) for mailman id 762183;
 Mon, 22 Jul 2024 15:08:50 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=JAiy=OW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sVueg-0004ZE-1D
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 15:08:50 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4b3685f9-483c-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 17:08:47 +0200 (CEST)
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 439301F8D4;
 Mon, 22 Jul 2024 15:08: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 07F68136A9;
 Mon, 22 Jul 2024 15:08:46 +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 BCNvAP51nmaOWAAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 22 Jul 2024 15:08:46 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b3685f9-483c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660926; 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=RpkEMa1JSkMWC23Fdqu7c4oTDk4EMFdNp4g2Q+Fetic=;
	b=fwUrGDDlXllR3vP4sUh+N5d5eC2PcGImuUJy2LZYYGexcwSug3ZhHgpZih/KdGV+ct297K
	mHkfKvPmET2CTzK85Jx8z2QXETNkamtpJI3avuHmILIHOFapcjxpACKe3eKTE56G4GT8U2
	RBsmQztXwcMj+VzudL25EqgdRJe3diU=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=fwUrGDDl
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721660926; 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=RpkEMa1JSkMWC23Fdqu7c4oTDk4EMFdNp4g2Q+Fetic=;
	b=fwUrGDDlXllR3vP4sUh+N5d5eC2PcGImuUJy2LZYYGexcwSug3ZhHgpZih/KdGV+ct297K
	mHkfKvPmET2CTzK85Jx8z2QXETNkamtpJI3avuHmILIHOFapcjxpACKe3eKTE56G4GT8U2
	RBsmQztXwcMj+VzudL25EqgdRJe3diU=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH] mini-os: mm: don't have two large arrays of the same kind
Date: Mon, 22 Jul 2024 17:08:43 +0200
Message-ID: <20240722150843.3947-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [0.19 / 50.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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]
X-Spam-Level: 
X-Rspamd-Queue-Id: 439301F8D4
X-Spam-Score: 0.19
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Bar: /

In the CONFIG_PARAVIRT case there are two identical static arrays of
more than 8kB size with function scope. As the two functions never
nest, a single array of file scope can replace the two existing
instances.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index be1cf0cf..7ddf16e4 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -198,6 +198,10 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
     *pt_pfn += 1;
 }
 
+#ifdef CONFIG_PARAVIRT
+static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
+#endif
+
 /*
  * Build the initial pagetable.
  */
@@ -209,7 +213,6 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
     unsigned long pt_mfn = pfn_to_mfn(virt_to_pfn(pt_base));
     unsigned long offset;
 #ifdef CONFIG_PARAVIRT
-    static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
     int count = 0;
     int rc;
 #endif
@@ -323,7 +326,6 @@ static void set_readonly(void *text, void *etext)
     unsigned long offset;
     unsigned long page_size = PAGE_SIZE;
 #ifdef CONFIG_PARAVIRT
-    static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
     int count = 0;
     int rc;
 #endif
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:27:03 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:27:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762349.1172506 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0Yd-0007Ew-6U; Mon, 22 Jul 2024 21:26:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762349.1172506; Mon, 22 Jul 2024 21:26:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0Yd-0007Ep-3c; Mon, 22 Jul 2024 21:26:59 +0000
Received: by outflank-mailman (input) for mailman id 762349;
 Mon, 22 Jul 2024 21:26:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0Yc-0007Ee-Bm
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:26:58 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1eb51e13-4871-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 23:26:56 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 4EE18A02D3;
 Mon, 22 Jul 2024 23:26:55 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id JAjeluPNITRN; Mon, 22 Jul 2024 23:26:55 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 13D23A02CA;
 Mon, 22 Jul 2024 23:26:55 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0YY-0000000APvC-2k7f; Mon, 22 Jul 2024 23:26:54 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eb51e13-4871-11ef-bbfe-fd08da9f4363
Date: Mon, 22 Jul 2024 23:26:54 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH] mini-os: mm: don't have two large arrays of the same kind
Message-ID: <20240722212654.exihzgrvnqxu36kt@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150843.3947-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722150843.3947-1-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 17:08:43 +0200, a ecrit:
> In the CONFIG_PARAVIRT case there are two identical static arrays of
> more than 8kB size with function scope. As the two functions never
> nest, a single array of file scope can replace the two existing
> instances.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/mm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index be1cf0cf..7ddf16e4 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -198,6 +198,10 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
>      *pt_pfn += 1;
>  }
>  
> +#ifdef CONFIG_PARAVIRT
> +static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
> +#endif
> +
>  /*
>   * Build the initial pagetable.
>   */
> @@ -209,7 +213,6 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
>      unsigned long pt_mfn = pfn_to_mfn(virt_to_pfn(pt_base));
>      unsigned long offset;
>  #ifdef CONFIG_PARAVIRT
> -    static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
>      int count = 0;
>      int rc;
>  #endif
> @@ -323,7 +326,6 @@ static void set_readonly(void *text, void *etext)
>      unsigned long offset;
>      unsigned long page_size = PAGE_SIZE;
>  #ifdef CONFIG_PARAVIRT
> -    static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
>      int count = 0;
>      int rc;
>  #endif
> -- 
> 2.43.0
> 

-- 
Samuel
/*
 * [...] Note that 120 sec is defined in the protocol as the maximum
 * possible RTT.  I guess we'll have to use something other than TCP
 * to talk to the University of Mars.
 * PAWS allows us longer timeouts and large windows, so once implemented
 * ftp to mars will work nicely.
 */
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:30:05 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762368.1172532 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0bd-0000YL-10; Mon, 22 Jul 2024 21:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762368.1172532; Mon, 22 Jul 2024 21:30:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0bc-0000Y6-QM; Mon, 22 Jul 2024 21:30:04 +0000
Received: by outflank-mailman (input) for mailman id 762368;
 Mon, 22 Jul 2024 21:30:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0bb-0000EF-Cf
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:30:03 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8dfce30b-4871-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 23:30:02 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 2AB8DA02D3;
 Mon, 22 Jul 2024 23:30:02 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id QKfM2qWowNs9; Mon, 22 Jul 2024 23:30:02 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 10AF0A02CA;
 Mon, 22 Jul 2024 23:30:02 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0bZ-0000000AY7o-2o5O; Mon, 22 Jul 2024 23:30:01 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8dfce30b-4871-11ef-bbfe-fd08da9f4363
Date: Mon, 22 Jul 2024 23:30:01 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 1/4] mini-os: make mm.c coding style compliant
Message-ID: <20240722213001.c43qzpjjmjqk2yq3@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-2-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722150141.31391-2-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 17:01:38 +0200, a ecrit:
> @@ -63,8 +63,8 @@ unsigned long nr_free_pages;
>  
>  /*
>   * Hint regarding bitwise arithmetic in map_{alloc,free}:
> - *  -(1<<n)  sets all bits >= n. 
> - *  (1<<n)-1 sets all bits <  n.
> + *  -(1 << n)  sets all bits >= n.
> + *  (1 << n) - 1 sets all bits <  n.

Please keep the alignment of "sets"

Apart this nitpick,

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Samuel


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:30:51 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:30:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762379.1172544 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0cN-0001Qn-7N; Mon, 22 Jul 2024 21:30:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762379.1172544; Mon, 22 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0cN-0001Qf-4E; Mon, 22 Jul 2024 21:30:51 +0000
Received: by outflank-mailman (input) for mailman id 762379;
 Mon, 22 Jul 2024 21:30:50 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0cM-00019C-5k
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:30:50 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a8bdc70e-4871-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 23:30:47 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 1077FA02D3;
 Mon, 22 Jul 2024 23:30:47 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id P3I1mg7LgkGu; Mon, 22 Jul 2024 23:30:46 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id E9A85A02CA;
 Mon, 22 Jul 2024 23:30:46 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0cI-0000000Aa9g-2KYE; Mon, 22 Jul 2024 23:30:46 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8bdc70e-4871-11ef-8776-851b0ebba9a2
Date: Mon, 22 Jul 2024 23:30:46 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 2/4] mini-os: mm: remove not needed struct chunk_tail_st
Message-ID: <20240722213046.3or2tuaipgggxyp4@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-3-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722150141.31391-3-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 17:01:39 +0200, a ecrit:
> The struct chunk_tail_st isn't really used other than writing to it.
> 
> Remove it in order to simplify the code.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  mm.c | 20 --------------------
>  1 file changed, 20 deletions(-)
> 
> diff --git a/mm.c b/mm.c
> index 1dcd954c..2cc49e94 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -123,7 +123,6 @@ static void map_free(unsigned long first_page, unsigned long nr_pages)
>  /* BINARY BUDDY ALLOCATOR */
>  
>  typedef struct chunk_head_st chunk_head_t;
> -typedef struct chunk_tail_st chunk_tail_t;
>  
>  struct chunk_head_st {
>      chunk_head_t  *next;
> @@ -131,10 +130,6 @@ struct chunk_head_st {
>      int            level;
>  };
>  
> -struct chunk_tail_st {
> -    int level;
> -};
> -
>  /* Linked lists of free chunks of different powers-of-two in size. */
>  #define FREELIST_SIZE ((sizeof(void *) << 3) - PAGE_SHIFT)
>  static chunk_head_t *free_head[FREELIST_SIZE];
> @@ -151,7 +146,6 @@ static void init_page_allocator(unsigned long min, unsigned long max)
>      unsigned long range;
>      unsigned long r_min, r_max;
>      chunk_head_t *ch;
> -    chunk_tail_t *ct;
>  
>      printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
>             (u_long)to_virt(min), min, (u_long)to_virt(max), max);
> @@ -215,14 +209,12 @@ static void init_page_allocator(unsigned long min, unsigned long max)
>              ch = (chunk_head_t *)r_min;
>              r_min += 1UL << i;
>              range -= 1UL << i;
> -            ct = (chunk_tail_t *)r_min - 1;
>              i -= PAGE_SHIFT;
>              ch->level       = i;
>              ch->next        = free_head[i];
>              ch->pprev       = &free_head[i];
>              ch->next->pprev = &ch->next;
>              free_head[i]    = ch;
> -            ct->level       = i;
>          }
>      }
>  
> @@ -234,7 +226,6 @@ unsigned long alloc_pages(int order)
>  {
>      int i;
>      chunk_head_t *alloc_ch, *spare_ch;
> -    chunk_tail_t            *spare_ct;
>  
>      if ( !chk_free_pages(1UL << order) )
>          goto no_memory;
> @@ -261,14 +252,11 @@ unsigned long alloc_pages(int order)
>          i--;
>          spare_ch = (chunk_head_t *)((char *)alloc_ch +
>                                      (1UL << (i + PAGE_SHIFT)));
> -        spare_ct = (chunk_tail_t *)((char *)spare_ch +
> -                                    (1UL << (i + PAGE_SHIFT))) - 1;
>  
>          /* Create new header for spare chunk. */
>          spare_ch->level = i;
>          spare_ch->next  = free_head[i];
>          spare_ch->pprev = &free_head[i];
> -        spare_ct->level = i;
>  
>          /* Link in the spare chunk. */
>          spare_ch->next->pprev = &spare_ch->next;
> @@ -289,7 +277,6 @@ EXPORT_SYMBOL(alloc_pages);
>  void free_pages(void *pointer, int order)
>  {
>      chunk_head_t *freed_ch, *to_merge_ch;
> -    chunk_tail_t *freed_ct;
>      unsigned long mask;
>  
>      /* First free the chunk */
> @@ -297,8 +284,6 @@ void free_pages(void *pointer, int order)
>  
>      /* Create free chunk */
>      freed_ch = (chunk_head_t *)pointer;
> -    freed_ct = (chunk_tail_t *)((char *)pointer +
> -                                (1UL << (order + PAGE_SHIFT))) - 1;
>  
>      /* Now, possibly we can conseal chunks together */
>      while ( order < FREELIST_SIZE )
> @@ -320,9 +305,6 @@ void free_pages(void *pointer, int order)
>              if ( allocated_in_map(virt_to_pfn(to_merge_ch)) ||
>                   to_merge_ch->level != order )
>                  break;
> -
> -            /* Merge with successor */
> -            freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask) - 1;
>          }
>  
>          /* We are committed to merging, unlink the chunk */
> @@ -336,8 +318,6 @@ void free_pages(void *pointer, int order)
>      freed_ch->level = order;
>      freed_ch->next  = free_head[order];
>      freed_ch->pprev = &free_head[order];
> -    freed_ct->level = order;
> -
>      freed_ch->next->pprev = &freed_ch->next;
>      free_head[order] = freed_ch;
>  
> -- 
> 2.43.0
> 

-- 
Samuel
/*
 * [...] Note that 120 sec is defined in the protocol as the maximum
 * possible RTT.  I guess we'll have to use something other than TCP
 * to talk to the University of Mars.
 * PAWS allows us longer timeouts and large windows, so once implemented
 * ftp to mars will work nicely.
 */
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:34:59 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:34:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762401.1172569 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0gM-0002i4-4n; Mon, 22 Jul 2024 21:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762401.1172569; Mon, 22 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0gM-0002hw-2B; Mon, 22 Jul 2024 21:34:58 +0000
Received: by outflank-mailman (input) for mailman id 762401;
 Mon, 22 Jul 2024 21:34:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0gL-0002hm-82
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:34:57 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3bd1147b-4872-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 23:34:54 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id BC607A02D3;
 Mon, 22 Jul 2024 23:34:53 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 0iNF4bzqf-Db; Mon, 22 Jul 2024 23:34:53 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 9CB80A02CA;
 Mon, 22 Jul 2024 23:34:53 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0gH-0000000AlLE-0xiA; Mon, 22 Jul 2024 23:34:53 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3bd1147b-4872-11ef-8776-851b0ebba9a2
Date: Mon, 22 Jul 2024 23:34:53 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 3/4] mini-os: mm: reduce buddy allocator list
 administration data
Message-ID: <20240722213453.2seamcvsig5zkff3@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-4-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722150141.31391-4-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 17:01:40 +0200, a ecrit:
> Today the administration data for the buddy allocator's lists consists
> of 2 arrays: one pointer array and one list element array for easier
> handling of the lists' tails.
> 
> Those arrays can be combined into one by dropping the pointer array and
> using a different list end indicator.
> 
> Add enqueue and dequeue helpers for better readability.
> 
> Change the level member type to unsigned int.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  mm.c | 73 ++++++++++++++++++++++++++++--------------------------------
>  1 file changed, 34 insertions(+), 39 deletions(-)
> 
> diff --git a/mm.c b/mm.c
> index 2cc49e94..96686a5c 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -125,16 +125,30 @@ static void map_free(unsigned long first_page, unsigned long nr_pages)
>  typedef struct chunk_head_st chunk_head_t;
>  
>  struct chunk_head_st {
> -    chunk_head_t  *next;
> -    chunk_head_t **pprev;
> -    int            level;
> +    chunk_head_t *next;
> +    chunk_head_t *prev;
> +    unsigned int  level;
>  };
>  
>  /* Linked lists of free chunks of different powers-of-two in size. */
>  #define FREELIST_SIZE ((sizeof(void *) << 3) - PAGE_SHIFT)
> -static chunk_head_t *free_head[FREELIST_SIZE];
> -static chunk_head_t  free_tail[FREELIST_SIZE];
> -#define FREELIST_EMPTY(_l) ((_l)->next == NULL)
> +static chunk_head_t  free_list[FREELIST_SIZE];
> +#define FREELIST_EMPTY(_l) ((_l)->level == FREELIST_SIZE)
> +
> +static void enqueue_elem(chunk_head_t *elem, unsigned int level)
> +{
> +    elem->level = level;
> +    elem->next = free_list[level].next;
> +    elem->prev = &free_list[level];
> +    elem->next->prev = elem;
> +    free_list[level].next = elem;
> +}
> +
> +static void dequeue_elem(chunk_head_t *elem)
> +{
> +    elem->prev->next = elem->next;
> +    elem->next->prev = elem->prev;
> +}
>  
>  /*
>   * Initialise allocator, placing addresses [@min,@max] in free pool.
> @@ -151,9 +165,9 @@ static void init_page_allocator(unsigned long min, unsigned long max)
>             (u_long)to_virt(min), min, (u_long)to_virt(max), max);
>      for ( i = 0; i < FREELIST_SIZE; i++ )
>      {
> -        free_head[i]       = &free_tail[i];
> -        free_tail[i].pprev = &free_head[i];
> -        free_tail[i].next  = NULL;
> +        free_list[i].next  = &free_list[i];
> +        free_list[i].prev  = &free_list[i];
> +        free_list[i].level = FREELIST_SIZE;
>      }
>  
>      min = round_pgup(min);
> @@ -209,12 +223,7 @@ static void init_page_allocator(unsigned long min, unsigned long max)
>              ch = (chunk_head_t *)r_min;
>              r_min += 1UL << i;
>              range -= 1UL << i;
> -            i -= PAGE_SHIFT;
> -            ch->level       = i;
> -            ch->next        = free_head[i];
> -            ch->pprev       = &free_head[i];
> -            ch->next->pprev = &ch->next;
> -            free_head[i]    = ch;
> +            enqueue_elem(ch, i - PAGE_SHIFT);
>          }
>      }
>  
> @@ -233,17 +242,16 @@ unsigned long alloc_pages(int order)
>      /* Find smallest order which can satisfy the request. */
>      for ( i = order; i < FREELIST_SIZE; i++ )
>      {
> -        if ( !FREELIST_EMPTY(free_head[i]) )
> +        if ( !FREELIST_EMPTY(free_list[i].next) )
>              break;
>      }
>  
> -    if ( i == FREELIST_SIZE )
> +    if ( i >= FREELIST_SIZE )
>          goto no_memory;
>  
>      /* Unlink a chunk. */
> -    alloc_ch = free_head[i];
> -    free_head[i] = alloc_ch->next;
> -    alloc_ch->next->pprev = alloc_ch->pprev;
> +    alloc_ch = free_list[i].next;
> +    dequeue_elem(alloc_ch);
>  
>      /* We may have to break the chunk a number of times. */
>      while ( i != order )
> @@ -254,13 +262,7 @@ unsigned long alloc_pages(int order)
>                                      (1UL << (i + PAGE_SHIFT)));
>  
>          /* Create new header for spare chunk. */
> -        spare_ch->level = i;
> -        spare_ch->next  = free_head[i];
> -        spare_ch->pprev = &free_head[i];
> -
> -        /* Link in the spare chunk. */
> -        spare_ch->next->pprev = &spare_ch->next;
> -        free_head[i] = spare_ch;
> +        enqueue_elem(spare_ch, i);
>      }
>  
>      map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL << order);
> @@ -308,18 +310,13 @@ void free_pages(void *pointer, int order)
>          }
>  
>          /* We are committed to merging, unlink the chunk */
> -        *(to_merge_ch->pprev) = to_merge_ch->next;
> -        to_merge_ch->next->pprev = to_merge_ch->pprev;
> +        dequeue_elem(to_merge_ch);
>  
>          order++;
>      }
>  
>      /* Link the new chunk */
> -    freed_ch->level = order;
> -    freed_ch->next  = free_head[order];
> -    freed_ch->pprev = &free_head[order];
> -    freed_ch->next->pprev = &freed_ch->next;
> -    free_head[order] = freed_ch;
> +    enqueue_elem(freed_ch, order);
>  
>  }
>  EXPORT_SYMBOL(free_pages);
> @@ -405,13 +402,11 @@ void sanity_check(void)
>  
>      for ( x = 0; x < FREELIST_SIZE; x++ )
>      {
> -        for ( head = free_head[x]; !FREELIST_EMPTY(head); head = head->next )
> +        for ( head = free_list[x].next; !FREELIST_EMPTY(head);
> +              head = head->next )
>          {
>              ASSERT(!allocated_in_map(virt_to_pfn(head)));
> -            if ( head->next )
> -                ASSERT(head->next->pprev == &head->next);
> +            ASSERT(head->next->prev == head);
>          }
> -        if ( free_head[x] )
> -            ASSERT(free_head[x]->pprev == &free_head[x]);
>      }
>  }
> -- 
> 2.43.0
> 

-- 
Samuel
/*
 * [...] Note that 120 sec is defined in the protocol as the maximum
 * possible RTT.  I guess we'll have to use something other than TCP
 * to talk to the University of Mars.
 * PAWS allows us longer timeouts and large windows, so once implemented
 * ftp to mars will work nicely.
 */
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:35:50 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:35:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762413.1172582 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0hC-0003HH-EM; Mon, 22 Jul 2024 21:35:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762413.1172582; Mon, 22 Jul 2024 21:35:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0hC-0003HA-Bp; Mon, 22 Jul 2024 21:35:50 +0000
Received: by outflank-mailman (input) for mailman id 762413;
 Mon, 22 Jul 2024 21:35:48 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0hA-0003Gj-Oi
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:35:48 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5aa2eaa5-4872-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 23:35:45 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 7FBE3A02D3;
 Mon, 22 Jul 2024 23:35:45 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id KJFKTno6uo6F; Mon, 22 Jul 2024 23:35:45 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 60FCFA02CA;
 Mon, 22 Jul 2024 23:35:45 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0h6-0000000Ankn-4A6Z; Mon, 22 Jul 2024 23:35:44 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5aa2eaa5-4872-11ef-8776-851b0ebba9a2
Date: Mon, 22 Jul 2024 23:35:44 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
Message-ID: <20240722213544.hjyohnoz4mtcfltr@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722150141.31391-5-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit:
> Remove the sanity_check() function, as it is used nowhere.
> 
> Since any application linked with Mini-OS can't call sanity_check()
> either (there is no EXPORT_SYMBOL for it), there is zero chance of
> breaking any use case.

Don't we still want to keep it around, at least as formal documentation
of the expected status of the list?

Samuel

> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  include/lib.h |  3 ---
>  mm.c          | 16 ----------------
>  2 files changed, 19 deletions(-)
> 
> diff --git a/include/lib.h b/include/lib.h
> index abd4e9ab..acd4acc6 100644
> --- a/include/lib.h
> +++ b/include/lib.h
> @@ -152,9 +152,6 @@ do {                                                           \
>  
>  #define BUG_ON(x) ASSERT(!(x))
>  
> -/* Consistency check as much as possible. */
> -void sanity_check(void);
> -
>  /* Get own domid. */
>  domid_t get_domid(void);
>  
> diff --git a/mm.c b/mm.c
> index 96686a5c..1fa7e7bf 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -394,19 +394,3 @@ void init_mm(void)
>  void fini_mm(void)
>  {
>  }
> -
> -void sanity_check(void)
> -{
> -    int x;
> -    chunk_head_t *head;
> -
> -    for ( x = 0; x < FREELIST_SIZE; x++ )
> -    {
> -        for ( head = free_list[x].next; !FREELIST_EMPTY(head);
> -              head = head->next )
> -        {
> -            ASSERT(!allocated_in_map(virt_to_pfn(head)));
> -            ASSERT(head->next->prev == head);
> -        }
> -    }
> -}
> -- 
> 2.43.0
> 

-- 
Samuel
/*
 * [...] Note that 120 sec is defined in the protocol as the maximum
 * possible RTT.  I guess we'll have to use something other than TCP
 * to talk to the University of Mars.
 * PAWS allows us longer timeouts and large windows, so once implemented
 * ftp to mars will work nicely.
 */
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:43:41 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:43:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762448.1172617 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0om-0006Fr-KB; Mon, 22 Jul 2024 21:43:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762448.1172617; Mon, 22 Jul 2024 21:43:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0om-0006Fk-H7; Mon, 22 Jul 2024 21:43:40 +0000
Received: by outflank-mailman (input) for mailman id 762448;
 Mon, 22 Jul 2024 21:43:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0ol-0006FZ-R4
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:43:39 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 733011c9-4873-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 23:43:36 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 23556A02D3;
 Mon, 22 Jul 2024 23:43:36 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id O2fIxkPsJrLC; Mon, 22 Jul 2024 23:43:36 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 041FCA02CA;
 Mon, 22 Jul 2024 23:43:36 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0oh-0000000B70A-2UUt; Mon, 22 Jul 2024 23:43:35 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 733011c9-4873-11ef-8776-851b0ebba9a2
Date: Mon, 22 Jul 2024 23:43:35 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 1/3] mini-os: apply coding style to arch/x86/time.c
Message-ID: <20240722214335.cb2spwsgacs43w55@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722121643.18116-1-jgross@suse.com>
 <20240722121643.18116-2-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722121643.18116-2-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 14:16:41 +0200, a ecrit:
> Apply the preferred coding style to arch/x86/time.c.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/time.c | 194 +++++++++++++++++++++++-------------------------
>  1 file changed, 93 insertions(+), 101 deletions(-)
> 
> diff --git a/arch/x86/time.c b/arch/x86/time.c
> index 332c0260..a473a9e1 100644
> --- a/arch/x86/time.c
> +++ b/arch/x86/time.c
> @@ -1,7 +1,7 @@
>  /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
>   ****************************************************************************
>   * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
> - * (C) 2002-2003 - Keir Fraser - University of Cambridge 
> + * (C) 2002-2003 - Keir Fraser - University of Cambridge
>   * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
>   * (C) 2006 - Robert Kaiser - FH Wiesbaden
>   ****************************************************************************
> @@ -18,20 +18,19 @@
>   * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
>   * sell copies of the Software, and to permit persons to whom the Software is
>   * furnished to do so, subject to the following conditions:
> - * 
> + *
>   * The above copyright notice and this permission notice shall be included in
>   * all copies or substantial portions of the Software.
> - * 
> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
> - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
> - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
> - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
> - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>   * DEALINGS IN THE SOFTWARE.
>   */
>  
> -
>  #include <mini-os/os.h>
>  #include <mini-os/traps.h>
>  #include <mini-os/types.h>
> @@ -46,44 +45,43 @@
>  
>  /* These are peridically updated in shared_info, and then copied here. */
>  struct shadow_time_info {
> -	uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
> -	uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
> -	uint32_t tsc_to_nsec_mul;
> -	uint32_t tsc_to_usec_mul;
> -	int tsc_shift;
> -	uint32_t version;
> +    uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
> +    uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
> +    uint32_t tsc_to_nsec_mul;
> +    uint32_t tsc_to_usec_mul;
> +    int tsc_shift;
> +    uint32_t version;
>  };
>  static struct timespec shadow_ts;
>  static uint32_t shadow_ts_version;
>  
>  static struct shadow_time_info shadow;
>  
> -
>  #ifndef rmb
> -#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
> +#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
>  #endif
>  
> -#define HANDLE_USEC_OVERFLOW(_tv)          \
> -    do {                                   \
> +#define HANDLE_USEC_OVERFLOW(_tv)           \
> +    do {                                    \
>          while ( (_tv)->tv_usec >= 1000000 ) \
> -        {                                  \
> +        {                                   \
>              (_tv)->tv_usec -= 1000000;      \
>              (_tv)->tv_sec++;                \
> -        }                                  \
> +        }                                   \
>      } while ( 0 )
>  
>  static inline int time_values_up_to_date(void)
>  {
> -	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time; 
> +    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
>  
> -	return (shadow.version == src->version);
> +    return shadow.version == src->version;
>  }
>  
>  static inline int wc_values_up_to_date(void)
>  {
> -	shared_info_t *s= HYPERVISOR_shared_info;
> +    shared_info_t *s = HYPERVISOR_shared_info;
>  
> -	return (shadow_ts_version == s->wc_version);
> +    return shadow_ts_version == s->wc_version;
>  }
>  
>  /*
> @@ -92,109 +90,104 @@ static inline int wc_values_up_to_date(void)
>   */
>  static inline uint64_t scale_delta(uint64_t delta, uint32_t mul_frac, int shift)
>  {
> -	uint64_t product;
> +    uint64_t product;
>  #ifdef __i386__
> -	uint32_t tmp1, tmp2;
> +    uint32_t tmp1, tmp2;
>  #endif
>  
> -	if ( shift < 0 )
> -		delta >>= -shift;
> -	else
> -		delta <<= shift;
> +    if ( shift < 0 )
> +        delta >>= -shift;
> +    else
> +        delta <<= shift;
>  
>  #ifdef __i386__
> -	__asm__ (
> -		"mul  %5       ; "
> -		"mov  %4,%%eax ; "
> -		"mov  %%edx,%4 ; "
> -		"mul  %5       ; "
> -		"add  %4,%%eax ; "
> -		"xor  %5,%5    ; "
> -		"adc  %5,%%edx ; "
> -		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
> -		: "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) );
> +    __asm__ (
> +        "mul  %5       ; "
> +        "mov  %4,%%eax ; "
> +        "mov  %%edx,%4 ; "
> +        "mul  %5       ; "
> +        "add  %4,%%eax ; "
> +        "xor  %5,%5    ; "
> +        "adc  %5,%%edx ; "
> +        : "=A" (product), "=r" (tmp1), "=r" (tmp2)
> +        : "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) );
>  #else
> -	__asm__ (
> -		"mul %%rdx ; shrd $32,%%rdx,%%rax"
> -		: "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) );
> +    __asm__ (
> +        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> +        : "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) );
>  #endif
>  
> -	return product;
> +    return product;
>  }
>  
> -
>  static unsigned long get_nsec_offset(void)
>  {
> -	uint64_t now, delta;
> -	rdtscll(now);
> -	delta = now - shadow.tsc_timestamp;
> -	return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
> -}
> +    uint64_t now, delta;
>  
> +    rdtscll(now);
> +    delta = now - shadow.tsc_timestamp;
> +
> +    return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
> +}
>  
>  static void get_time_values_from_xen(void)
>  {
> -	struct vcpu_time_info    *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> -
> - 	do {
> -		shadow.version = src->version;
> -		rmb();
> -		shadow.tsc_timestamp     = src->tsc_timestamp;
> -		shadow.system_timestamp  = src->system_time;
> -		shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
> -		shadow.tsc_shift         = src->tsc_shift;
> -		rmb();
> -	}
> -	while ((src->version & 1) | (shadow.version ^ src->version));
> -
> -	shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
> +    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> +
> +    do {
> +        shadow.version = src->version;
> +        rmb();
> +        shadow.tsc_timestamp     = src->tsc_timestamp;
> +        shadow.system_timestamp  = src->system_time;
> +        shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
> +        shadow.tsc_shift         = src->tsc_shift;
> +        rmb();
> +    } while ( (src->version & 1) | (shadow.version ^ src->version) );
> +
> +    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
>  }
>  
> -
> -
> -
> -/* monotonic_clock(): returns # of nanoseconds passed since time_init()
> - *		Note: This function is required to return accurate
> - *		time even in the absence of multiple timer ticks.
> +/*
> + * monotonic_clock(): returns # of nanoseconds passed since time_init()
> + *        Note: This function is required to return accurate
> + *        time even in the absence of multiple timer ticks.
>   */
>  uint64_t monotonic_clock(void)
>  {
> -	uint64_t time;
> -	uint32_t local_time_version;
> -
> -	do {
> -		local_time_version = shadow.version;
> -		rmb();
> -		time = shadow.system_timestamp + get_nsec_offset();
> -		if (!time_values_up_to_date())
> -			get_time_values_from_xen();
> -		rmb();
> -	} while (local_time_version != shadow.version);
> -
> -	return time;
> +    uint64_t time;
> +    uint32_t local_time_version;
> +
> +    do {
> +        local_time_version = shadow.version;
> +        rmb();
> +        time = shadow.system_timestamp + get_nsec_offset();
> +        if ( !time_values_up_to_date() )
> +            get_time_values_from_xen();
> +        rmb();
> +    } while ( local_time_version != shadow.version );
> +
> +    return time;
>  }
>  
>  static void update_wallclock(void)
>  {
> -	shared_info_t *s = HYPERVISOR_shared_info;
> -
> -	do {
> -		shadow_ts_version = s->wc_version;
> -		rmb();
> -		shadow_ts.tv_sec  = s->wc_sec;
> -		shadow_ts.tv_nsec = s->wc_nsec;
> -		rmb();
> -	}
> -	while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version));
> +    shared_info_t *s = HYPERVISOR_shared_info;
> +
> +    do {
> +        shadow_ts_version = s->wc_version;
> +        rmb();
> +        shadow_ts.tv_sec  = s->wc_sec;
> +        shadow_ts.tv_nsec = s->wc_nsec;
> +        rmb();
> +    } while ( (s->wc_version & 1) | (shadow_ts_version ^ s->wc_version) );
>  }
>  
> -
>  int gettimeofday(struct timeval *tv, void *tz)
>  {
>      uint64_t nsec = monotonic_clock();
>  
> -    if (!wc_values_up_to_date())
> -	update_wallclock();
> +    if ( !wc_values_up_to_date() )
> +        update_wallclock();
>  
>      nsec += shadow_ts.tv_nsec;
>  
> @@ -209,7 +202,7 @@ EXPORT_SYMBOL(gettimeofday);
>  void block_domain(s_time_t until)
>  {
>      ASSERT(irqs_disabled());
> -    if(monotonic_clock() < until)
> +    if ( monotonic_clock() < until )
>      {
>          HYPERVISOR_set_timer_op(until);
>  #ifdef CONFIG_PARAVIRT
> @@ -228,9 +221,8 @@ static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
>      HYPERVISOR_set_timer_op(monotonic_clock() + MILLISECS(1));
>  }
>  
> -
> -
>  static evtchn_port_t port;
> +
>  void init_time(void)
>  {
>      port = bind_virq(VIRQ_TIMER, &timer_handler, NULL);
> -- 
> 2.43.0
> 

-- 
Samuel
"I don't know why, but first C programs tend to look a lot worse than
first programs in any other language (maybe except for fortran, but then
I suspect all fortran programs look like `firsts')"
(By Olaf Kirch)


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:45:43 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762462.1172631 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0ql-0006vF-3e; Mon, 22 Jul 2024 21:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762462.1172631; Mon, 22 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0ql-0006v7-0v; Mon, 22 Jul 2024 21:45:43 +0000
Received: by outflank-mailman (input) for mailman id 762462;
 Mon, 22 Jul 2024 21:45:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0qk-0006ux-70
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:45:42 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bd9d1726-4873-11ef-bbfe-fd08da9f4363;
 Mon, 22 Jul 2024 23:45:41 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 1183EA02D3;
 Mon, 22 Jul 2024 23:45:41 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id GJUrgj4RGxnl; Mon, 22 Jul 2024 23:45:40 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id EA9A4A02CA;
 Mon, 22 Jul 2024 23:45:40 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0qi-0000000BCk4-21vI; Mon, 22 Jul 2024 23:45:40 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd9d1726-4873-11ef-bbfe-fd08da9f4363
Date: Mon, 22 Jul 2024 23:45:40 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 2/3] mini-os: remove some not needed stuff from
 arch/x86/time.c
Message-ID: <20240722214540.2stt5dzsw7ywltbf@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722121643.18116-1-jgross@suse.com>
 <20240722121643.18116-3-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722121643.18116-3-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 14:16:42 +0200, a ecrit:
> Remove unused or not needed stuff from arch/x86/time.c.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/time.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/arch/x86/time.c b/arch/x86/time.c
> index a473a9e1..7fd7abef 100644
> --- a/arch/x86/time.c
> +++ b/arch/x86/time.c
> @@ -48,7 +48,6 @@ struct shadow_time_info {
>      uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
>      uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
>      uint32_t tsc_to_nsec_mul;
> -    uint32_t tsc_to_usec_mul;
>      int tsc_shift;
>      uint32_t version;
>  };
> @@ -57,19 +56,6 @@ static uint32_t shadow_ts_version;
>  
>  static struct shadow_time_info shadow;
>  
> -#ifndef rmb
> -#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
> -#endif
> -
> -#define HANDLE_USEC_OVERFLOW(_tv)           \
> -    do {                                    \
> -        while ( (_tv)->tv_usec >= 1000000 ) \
> -        {                                   \
> -            (_tv)->tv_usec -= 1000000;      \
> -            (_tv)->tv_sec++;                \
> -        }                                   \
> -    } while ( 0 )
> -
>  static inline int time_values_up_to_date(void)
>  {
>      struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> @@ -143,8 +129,6 @@ static void get_time_values_from_xen(void)
>          shadow.tsc_shift         = src->tsc_shift;
>          rmb();
>      } while ( (src->version & 1) | (shadow.version ^ src->version) );
> -
> -    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
>  }
>  
>  /*
> -- 
> 2.43.0
> 

-- 
Samuel
"I don't know why, but first C programs tend to look a lot worse than
first programs in any other language (maybe except for fortran, but then
I suspect all fortran programs look like `firsts')"
(By Olaf Kirch)


From minios-devel-bounces@lists.xenproject.org Mon Jul 22 21:53:25 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 22 Jul 2024 21:53:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762484.1172654 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0yC-0000mg-37; Mon, 22 Jul 2024 21:53:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762484.1172654; Mon, 22 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sW0yC-0000mZ-0c; Mon, 22 Jul 2024 21:53:24 +0000
Received: by outflank-mailman (input) for mailman id 762484;
 Mon, 22 Jul 2024 21:53:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TuwE=OW=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sW0yA-0000YB-Le
 for minios-devel@lists.xenproject.org; Mon, 22 Jul 2024 21:53:22 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ce583c1b-4874-11ef-8776-851b0ebba9a2;
 Mon, 22 Jul 2024 23:53:18 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 8E6C2A02D3;
 Mon, 22 Jul 2024 23:53:18 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 4i9YF_Rbm8jg; Mon, 22 Jul 2024 23:53:18 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 6FA4DA02CA;
 Mon, 22 Jul 2024 23:53:18 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sW0y5-0000000BETl-3tdS; Mon, 22 Jul 2024 23:53:17 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce583c1b-4874-11ef-8776-851b0ebba9a2
Date: Mon, 22 Jul 2024 23:53:17 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 3/3] mini-os: simplify monotonic_clock()
Message-ID: <20240722215317.sbtvdr6wpfe4qz7r@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722121643.18116-1-jgross@suse.com>
 <20240722121643.18116-4-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240722121643.18116-4-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le lun. 22 juil. 2024 14:16:43 +0200, a ecrit:
> monotonic_clock() in arch/x86/time.c is more complex than needed: it
> has basically two nested loops making sure the time data obtained from
> Xen are valid.
> 
> Simplify that by merging some of the used sub-functions into the main
> function and using only a single loop. Further simplify the code by
> using struct vcpu_time_info for the local instance instead of defining
> a similar structure in the code.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/time.c | 58 ++++++++++++++-----------------------------------
>  1 file changed, 16 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/x86/time.c b/arch/x86/time.c
> index 7fd7abef..52916e15 100644
> --- a/arch/x86/time.c
> +++ b/arch/x86/time.c
> @@ -44,24 +44,10 @@
>   *************************************************************************/
>  
>  /* These are peridically updated in shared_info, and then copied here. */
> -struct shadow_time_info {
> -    uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
> -    uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
> -    uint32_t tsc_to_nsec_mul;
> -    int tsc_shift;
> -    uint32_t version;
> -};
>  static struct timespec shadow_ts;
>  static uint32_t shadow_ts_version;
>  
> -static struct shadow_time_info shadow;
> -
> -static inline int time_values_up_to_date(void)
> -{
> -    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> -
> -    return shadow.version == src->version;
> -}
> +static struct vcpu_time_info shadow;
>  
>  static inline int wc_values_up_to_date(void)
>  {
> @@ -113,22 +99,7 @@ static unsigned long get_nsec_offset(void)
>      rdtscll(now);
>      delta = now - shadow.tsc_timestamp;
>  
> -    return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
> -}
> -
> -static void get_time_values_from_xen(void)
> -{
> -    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> -
> -    do {
> -        shadow.version = src->version;
> -        rmb();
> -        shadow.tsc_timestamp     = src->tsc_timestamp;
> -        shadow.system_timestamp  = src->system_time;
> -        shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
> -        shadow.tsc_shift         = src->tsc_shift;
> -        rmb();
> -    } while ( (src->version & 1) | (shadow.version ^ src->version) );
> +    return scale_delta(delta, shadow.tsc_to_system_mul, shadow.tsc_shift);
>  }
>  
>  /*
> @@ -138,19 +109,22 @@ static void get_time_values_from_xen(void)
>   */
>  uint64_t monotonic_clock(void)
>  {
> -    uint64_t time;
> -    uint32_t local_time_version;
> +    struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
>  
> -    do {
> -        local_time_version = shadow.version;
> -        rmb();
> -        time = shadow.system_timestamp + get_nsec_offset();
> -        if ( !time_values_up_to_date() )
> -            get_time_values_from_xen();
> -        rmb();
> -    } while ( local_time_version != shadow.version );
> +    if ( shadow.version != src->version )
> +    {
> +        do {
> +            shadow.version = src->version;
> +            rmb();
> +            shadow.tsc_timestamp     = src->tsc_timestamp;
> +            shadow.system_time       = src->system_time;
> +            shadow.tsc_to_system_mul = src->tsc_to_system_mul;
> +            shadow.tsc_shift         = src->tsc_shift;
> +            rmb();
> +        } while ( (src->version & 1) || (shadow.version != src->version) );
> +    }
>  
> -    return time;
> +    return shadow.system_time + get_nsec_offset();
>  }
>  
>  static void update_wallclock(void)
> -- 
> 2.43.0
> 

-- 
Samuel
"I don't know why, but first C programs tend to look a lot worse than
first programs in any other language (maybe except for fortran, but then
I suspect all fortran programs look like `firsts')"
(By Olaf Kirch)


From minios-devel-bounces@lists.xenproject.org Tue Jul 23 06:36:18 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 23 Jul 2024 06:36:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.762627.1172835 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW98D-0000z9-Fb; Tue, 23 Jul 2024 06:36:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 762627.1172835; Tue, 23 Jul 2024 06:36:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sW98D-0000z2-D9; Tue, 23 Jul 2024 06:36:17 +0000
Received: by outflank-mailman (input) for mailman id 762627;
 Tue, 23 Jul 2024 06:36:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=BZ+O=OX=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sW98C-0000yu-Fy
 for minios-devel@lists.xenproject.org; Tue, 23 Jul 2024 06:36:16 +0000
Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com
 [2a00:1450:4864:20::333])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc5aa917-48bd-11ef-bbfe-fd08da9f4363;
 Tue, 23 Jul 2024 08:36:15 +0200 (CEST)
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-426717a2d12so25690285e9.0
 for <minios-devel@lists.xenproject.org>; Mon, 22 Jul 2024 23:36:15 -0700 (PDT)
Received: from ?IPV6:2003:e5:8729:4000:29eb:6d9d:3214:39d2?
 (p200300e58729400029eb6d9d321439d2.dip0.t-ipconnect.de.
 [2003:e5:8729:4000:29eb:6d9d:3214:39d2])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-427d2a94c30sm186095845e9.47.2024.07.22.23.36.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 22 Jul 2024 23:36:14 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc5aa917-48bd-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1721716575; x=1722321375; darn=lists.xenproject.org;
        h=content-transfer-encoding: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;
        bh=ZZsEviKFG3wTW1BzdmZxS8T6IyNpfu8fyNZg8X0k2a0=;
        b=RT88ItpRJPekiNEFlVFtZA8ZPoccYKtxfz4ztfVSJ4JVKs2HrTPZg1LW/HiJ6ay6KA
         VgboPt79plA5Ulg6cjGPJ9J1a7Mz0rtXbKXkQ5CEu1JRgRYyIItRMiTQ33RhwCa2eVvm
         oxzFdsszc80B1Cw+UITL1agFKR3M/ij6YksmzQSGNxaZNc5IgSW7Zcp6QJv4EdiCIOJa
         IyaZTktPzH+0QlAMww2YVJwQ6S7m7+FdrOFSpoqJmhpKiCnDZMp5z9No7l9nF4/l28BG
         kX/OtFu2Wlhyy/Md9LDSB1ZOPi4IHei1xrQwp/86oGxDOS8Q3+vbfzeUVB7e87bJMi2C
         Ka7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721716575; x=1722321375;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ZZsEviKFG3wTW1BzdmZxS8T6IyNpfu8fyNZg8X0k2a0=;
        b=JW6fYpMdvyIp2XmwWcMIBdSKWGmPSBDq9a8O5VzKHZSR/5fjhOSrlYll3b1UVJFrXx
         idJvLb/4rUzaXUBK5weouOLVrcWzButxjyNUw5NV8gdMRCATNQz9g6WtkrmwU0Sosx3j
         5l29/gRtS1fP7IepAq3LVkJRAB2dBrX6C0DlPH33FdXadNxCYWgYx/j1tJ3/3ujtGJ6P
         pCDtFdvpLujSp6WIlv289d18O7nsC69uTgBbuZyQOEsV6el/47gJaI2fD27XbnYTQHfX
         huuOP3QeUenIef57XB2+zmCBn58kBT3PiOovB68AeXA5y5TJuPTIpJwC6kJi6cKVF/UQ
         GXCw==
X-Forwarded-Encrypted: i=1; AJvYcCXxO1e8k9IFWhL/JyzMevsLUiPsEpmkAVDJIdnOFP+2M4a2gOFBtEvFbqj3DCqachqqNr0fPZZRlCexa7mk696gIex0CaVB0eVWfha280LoyFY=
X-Gm-Message-State: AOJu0YyYtNbWTCv9RfpGOPSrAM2jOQWUbXOyqSXGBN16gIMAW0iYzBE9
	A1K6Xb7OLCPAlpjOJ1kHMb30yW5bhP2sejxK+hTHY9GCCo3BZlF5zet59i+Abww=
X-Google-Smtp-Source: AGHT+IFN3fahd1hwRSpW0sk1Yg2dTUOzpPenu6V5gXlgFatZeJpbcGMNoAGO+hQTOB77LHTvlfdqBg==
X-Received: by 2002:a05:600c:4694:b0:426:5b19:d2b3 with SMTP id 5b1f17b1804b1-427ef3a8937mr6548375e9.14.1721716575048;
        Mon, 22 Jul 2024 23:36:15 -0700 (PDT)
Message-ID: <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
Date: Tue, 23 Jul 2024 08:36:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240722213544.hjyohnoz4mtcfltr@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 22.07.24 23:35, Samuel Thibault wrote:
> Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit:
>> Remove the sanity_check() function, as it is used nowhere.
>>
>> Since any application linked with Mini-OS can't call sanity_check()
>> either (there is no EXPORT_SYMBOL for it), there is zero chance of
>> breaking any use case.
> 
> Don't we still want to keep it around, at least as formal documentation
> of the expected status of the list?

Hmm, is it really worth the extra code?

There are 2 ASSERT()s I'm deleting: one testing the allocation bitmap
to match the comment further up:

/*
  * ALLOCATION BITMAP
  *  One bit per page of memory. Bit set => page is allocated.
  */

And the other one testing the linked lists being correct, which IMO
doesn't need any further documentation.


Juergen


From minios-devel-bounces@lists.xenproject.org Wed Jul 24 22:44:41 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 22:44:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764558.1175030 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWkis-0006bt-Pk; Wed, 24 Jul 2024 22:44:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764558.1175030; Wed, 24 Jul 2024 22:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWkis-0006bm-Ly; Wed, 24 Jul 2024 22:44:38 +0000
Received: by outflank-mailman (input) for mailman id 764558;
 Wed, 24 Jul 2024 22:44:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7T/i=OY=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sWkir-0006bY-88
 for minios-devel@lists.xenproject.org; Wed, 24 Jul 2024 22:44:37 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b752ae5-4a0e-11ef-bbff-fd08da9f4363;
 Thu, 25 Jul 2024 00:44:35 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 8AA46A038F;
 Thu, 25 Jul 2024 00:44:32 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 8yB0qiCt7ad1; Thu, 25 Jul 2024 00:44:32 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 676E2A038D;
 Thu, 25 Jul 2024 00:44:32 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sWkil-0000000BNLX-1y2I; Thu, 25 Jul 2024 00:44:31 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b752ae5-4a0e-11ef-bbff-fd08da9f4363
Date: Thu, 25 Jul 2024 00:44:31 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
Message-ID: <20240724224431.jelemlo6tt2jgaw2@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	=?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>,
	minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
 <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Hello,

Jürgen Groß, le mar. 23 juil. 2024 08:36:13 +0200, a ecrit:
> On 22.07.24 23:35, Samuel Thibault wrote:
> > Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit:
> > > Remove the sanity_check() function, as it is used nowhere.
> > > 
> > > Since any application linked with Mini-OS can't call sanity_check()
> > > either (there is no EXPORT_SYMBOL for it), there is zero chance of
> > > breaking any use case.
> > 
> > Don't we still want to keep it around, at least as formal documentation
> > of the expected status of the list?
> 
> Hmm, is it really worth the extra code?

I have already seen such kind of piece of code getting very convenient
when tracking odd bugs.

Samuel


From minios-devel-bounces@lists.xenproject.org Thu Jul 25 06:25:24 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jul 2024 06:25:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764646.1175131 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWruj-00060p-QU; Thu, 25 Jul 2024 06:25:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764646.1175131; Thu, 25 Jul 2024 06:25:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWruj-00060h-NI; Thu, 25 Jul 2024 06:25:21 +0000
Received: by outflank-mailman (input) for mailman id 764646;
 Thu, 25 Jul 2024 06:25:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/jnY=OZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sWrui-00060X-Tr
 for minios-devel@lists.xenproject.org; Thu, 25 Jul 2024 06:25:20 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa750c4b-4a4e-11ef-bbff-fd08da9f4363;
 Thu, 25 Jul 2024 08:25:20 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5a20de39cfbso673452a12.1
 for <minios-devel@lists.xenproject.org>; Wed, 24 Jul 2024 23:25:20 -0700 (PDT)
Received: from ?IPV6:2003:e5:8729:4000:29eb:6d9d:3214:39d2?
 (p200300e58729400029eb6d9d321439d2.dip0.t-ipconnect.de.
 [2003:e5:8729:4000:29eb:6d9d:3214:39d2])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acad41983sm35993866b.108.2024.07.24.23.25.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 23:25:19 -0700 (PDT)
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa750c4b-4a4e-11ef-bbff-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1721888719; x=1722493519; darn=lists.xenproject.org;
        h=content-transfer-encoding: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;
        bh=DQTDIw25o9tj4BCQ2SvHzxN+J5CCzsukrTbMLcryhQU=;
        b=PNGCtsktbCLUnPV7BYe26m0fuk/4Z5ybxMYGd7rCm4VPIRr+FLERi0lKUnCqDkB8lE
         lvodwOY67c7Zqrn+Oq6RE00iUjMOWaVrERDEvsD1a+9cdps6xghs3s+HQ4DVsFHldfrP
         u8rPUZiEJO72vBMlk+JV2yXqzQxk0hppgkq8Cxs+SNzQ2f+IknDPzqz/CLcqMflhZ2Am
         ZJPJqFV9MKEBHB0f6T82KsBlv+PFTJMBvkeicsa6dw5r8rqYRc+q46JgBRaz7QoiSWxl
         KBUbtuocRSm7PawEOv8/xm3pu8Kut/FLh8Y4RMVK1Enius6095lZzBO6S1bzreeEEJPu
         FT/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721888719; x=1722493519;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=DQTDIw25o9tj4BCQ2SvHzxN+J5CCzsukrTbMLcryhQU=;
        b=tRsDt0Rg5aRnY69ofwO8oX1/gB7Ci4gNyRNpCuwGbRl01Czee4ybasLCUSN0mR3bhE
         D6ZRlJLiUiqgwn13y3tf5NSd6wXPXYxk5/Dc+Xf5k2pjdKRSM6be9NmBiSwvlBp+LyQp
         tddjtP1w6y0FjR0r1xoUZS9v/IpN6Ns7Lsx6JIlmYFjfxjkVEcImLSXkNggcCFkz4FgT
         BKoiq3si1JHJw2Bzj6fTU3GLFXlX+3AC7P5IZEw9wcwjx4uIIE0EJhHK1sim4/CiBy7c
         PKHnarHvFarMgmEt6ZDqECUA6vuIIk7UBCkP8mrjWfJ7XwgrlPmOa6Qy/B1Wc/z8sPsC
         FpkA==
X-Forwarded-Encrypted: i=1; AJvYcCV9b6Qd0D3fmj3h/uBBJnjLIKuQAYlJDmf2gb5UhP2B9bpDbfh/3qet4pTu3rXMWh1tPWEg/EzA3LlpDW4tlyGUgyoJIf01jLw3Ux8y6F9FCfk=
X-Gm-Message-State: AOJu0YwulNjaEfMTKiZESniIN089x9GSi3/O6FxTiRmx7XuuNlo7uUBS
	haZMT9YOLAaHe9jUBawXbEGz4hE/dk4hd5o5Uwhvnym7hFeQWlOx9i9ApmpPldiV5MH9JjM5QVo
	V
X-Google-Smtp-Source: AGHT+IH9XJZZ/soxZciMQtO7yiJTM5uei0LGraN598e42YLk/RTTRYj/7cJIBsI3WCnySWiu/cd7BQ==
X-Received: by 2002:a17:907:a08:b0:a7a:ab8a:384 with SMTP id a640c23a62f3a-a7acb931dedmr46908866b.64.1721888719376;
        Wed, 24 Jul 2024 23:25:19 -0700 (PDT)
Message-ID: <7b76ceae-181d-4371-8feb-195fd4cc6d90@suse.com>
Date: Thu, 25 Jul 2024 08:25:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
 <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
 <20240724224431.jelemlo6tt2jgaw2@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240724224431.jelemlo6tt2jgaw2@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 25.07.24 00:44, Samuel Thibault wrote:
> Hello,
> 
> Jürgen Groß, le mar. 23 juil. 2024 08:36:13 +0200, a ecrit:
>> On 22.07.24 23:35, Samuel Thibault wrote:
>>> Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit:
>>>> Remove the sanity_check() function, as it is used nowhere.
>>>>
>>>> Since any application linked with Mini-OS can't call sanity_check()
>>>> either (there is no EXPORT_SYMBOL for it), there is zero chance of
>>>> breaking any use case.
>>>
>>> Don't we still want to keep it around, at least as formal documentation
>>> of the expected status of the list?
>>
>> Hmm, is it really worth the extra code?
> 
> I have already seen such kind of piece of code getting very convenient
> when tracking odd bugs.

What about putting it under CONFIG_TEST then?

This would keep it in the source and it would even be compile tested by
a simple "make testbuild", which is a simple test I'm always doing
before submitting a patch.


Juergen



From minios-devel-bounces@lists.xenproject.org Thu Jul 25 06:29:10 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jul 2024 06:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764658.1175155 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWryP-00072l-H1; Thu, 25 Jul 2024 06:29:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764658.1175155; Thu, 25 Jul 2024 06:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWryP-00072d-E1; Thu, 25 Jul 2024 06:29:09 +0000
Received: by outflank-mailman (input) for mailman id 764658;
 Thu, 25 Jul 2024 06:29:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Od1u=OZ=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sWryO-0006oA-Aj
 for minios-devel@lists.xenproject.org; Thu, 25 Jul 2024 06:29:08 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2f84e0e2-4a4f-11ef-8776-851b0ebba9a2;
 Thu, 25 Jul 2024 08:29:04 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 02667A0304;
 Thu, 25 Jul 2024 08:29:03 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id OtxuR0i-bsvf; Thu, 25 Jul 2024 08:29:02 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id B859CA02C4;
 Thu, 25 Jul 2024 08:29:02 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sWryI-000000003Vp-1Ko8; Thu, 25 Jul 2024 08:29:02 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f84e0e2-4a4f-11ef-8776-851b0ebba9a2
Date: Thu, 25 Jul 2024 08:29:02 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
Message-ID: <20240725062902.croun5gpmgfplfyt@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	=?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>,
	minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
 <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
 <20240724224431.jelemlo6tt2jgaw2@begin>
 <7b76ceae-181d-4371-8feb-195fd4cc6d90@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <7b76ceae-181d-4371-8feb-195fd4cc6d90@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Jürgen Groß, le jeu. 25 juil. 2024 08:25:18 +0200, a ecrit:
> On 25.07.24 00:44, Samuel Thibault wrote:
> > Hello,
> > 
> > Jürgen Groß, le mar. 23 juil. 2024 08:36:13 +0200, a ecrit:
> > > On 22.07.24 23:35, Samuel Thibault wrote:
> > > > Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit:
> > > > > Remove the sanity_check() function, as it is used nowhere.
> > > > > 
> > > > > Since any application linked with Mini-OS can't call sanity_check()
> > > > > either (there is no EXPORT_SYMBOL for it), there is zero chance of
> > > > > breaking any use case.
> > > > 
> > > > Don't we still want to keep it around, at least as formal documentation
> > > > of the expected status of the list?
> > > 
> > > Hmm, is it really worth the extra code?
> > 
> > I have already seen such kind of piece of code getting very convenient
> > when tracking odd bugs.
> 
> What about putting it under CONFIG_TEST then?

Ok !

Samuel


From minios-devel-bounces@lists.xenproject.org Thu Jul 25 06:40:59 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jul 2024 06:40:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764684.1175179 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWs9q-0002B8-TR; Thu, 25 Jul 2024 06:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764684.1175179; Thu, 25 Jul 2024 06:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWs9q-0002B1-Q9; Thu, 25 Jul 2024 06:40:58 +0000
Received: by outflank-mailman (input) for mailman id 764684;
 Thu, 25 Jul 2024 06:40:56 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/jnY=OZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sWs9o-0002Ak-Kv
 for minios-devel@lists.xenproject.org; Thu, 25 Jul 2024 06:40:56 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de
 [2a07:de40:b251:101:10:150:64:1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d6c7f67f-4a50-11ef-8776-851b0ebba9a2;
 Thu, 25 Jul 2024 08:40:53 +0200 (CEST)
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 EC55321A9C;
 Thu, 25 Jul 2024 06:40: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 BDC1513874;
 Thu, 25 Jul 2024 06:40: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 WZHCLHTzoWZECgAAD6G6ig
 (envelope-from <jgross@suse.com>); Thu, 25 Jul 2024 06:40:52 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6c7f67f-4a50-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721889653; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=S4kS8VMWkCS8vOn9IpAnhLR4KboBpI7iPk1Vz8YTmrI=;
	b=i+wlaYUcBG/c7s97dbHRN5A2Dk1lfQ1CSyv4oTaoX42sm+YtymEdxk70b5xsK8QlLTv3bb
	B6xqHb5mhkyJxVNWeBDanQp2Gu+IWndEkHVa2tkSKZFEOrQerA74SAiaJaNcnbDdAgqn85
	XP0D65E6jQblQ64nWizKMOocK2eUOHE=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721889652; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=S4kS8VMWkCS8vOn9IpAnhLR4KboBpI7iPk1Vz8YTmrI=;
	b=A1fSnjEQSSpSMl9QcUl/djssZquY0wNe+d8RZDudJqSnYByxDZWO7/VfxbWqeTG1nQl59E
	YCC9qzTTg8XE/ubvloYiH5Dgm9jGDOWtoOGNT4TZ/ldsbASPXlG/tg4S8QclqtfnOm8iSH
	/QqkcyNX1DeAW9Nar8MVSaKhtCsUsm4=
Message-ID: <39396c60-691f-422c-a065-7d148a81977d@suse.com>
Date: Thu, 25 Jul 2024 08:40:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
 <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
 <20240724224431.jelemlo6tt2jgaw2@begin>
 <7b76ceae-181d-4371-8feb-195fd4cc6d90@suse.com>
 <20240725062902.croun5gpmgfplfyt@begin>
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: <20240725062902.croun5gpmgfplfyt@begin>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------7cdd5Knu3JOrgWvNmis168ZQ"
X-Spamd-Result: default: False [-5.99 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SIGNED_PGP(-2.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	MIME_BASE64_TEXT(0.10)[];
	XM_UA_NO_VERSION(0.01)[];
	MID_RHS_MATCH_FROM(0.00)[];
	TO_DN_SOME(0.00)[];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_THREE(0.00)[4];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo];
	HAS_ATTACHMENT(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO
X-Spam-Score: -5.99

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------7cdd5Knu3JOrgWvNmis168ZQ
Content-Type: multipart/mixed; boundary="------------96XCosfT8gZudRYgzDFfjsOZ";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org
Message-ID: <39396c60-691f-422c-a065-7d148a81977d@suse.com>
Subject: Re: [PATCH 4/4] mini-os: remove sanity_check()
References: <20240722150141.31391-1-jgross@suse.com>
 <20240722150141.31391-5-jgross@suse.com>
 <20240722213544.hjyohnoz4mtcfltr@begin>
 <884d746c-47e4-4d0f-87a9-e2a03d2a3286@suse.com>
 <20240724224431.jelemlo6tt2jgaw2@begin>
 <7b76ceae-181d-4371-8feb-195fd4cc6d90@suse.com>
 <20240725062902.croun5gpmgfplfyt@begin>
In-Reply-To: <20240725062902.croun5gpmgfplfyt@begin>

--------------96XCosfT8gZudRYgzDFfjsOZ
Content-Type: multipart/mixed; boundary="------------BKXl3rn22l0PYF1iVOm178o4"

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

T24gMjUuMDcuMjQgMDg6MjksIFNhbXVlbCBUaGliYXVsdCB3cm90ZToNCj4gSsO8cmdlbiBH
cm/DnywgbGUgamV1LiAyNSBqdWlsLiAyMDI0IDA4OjI1OjE4ICswMjAwLCBhIGVjcml0Og0K
Pj4gT24gMjUuMDcuMjQgMDA6NDQsIFNhbXVlbCBUaGliYXVsdCB3cm90ZToNCj4+PiBIZWxs
bywNCj4+Pg0KPj4+IErDvHJnZW4gR3Jvw58sIGxlIG1hci4gMjMganVpbC4gMjAyNCAwODoz
NjoxMyArMDIwMCwgYSBlY3JpdDoNCj4+Pj4gT24gMjIuMDcuMjQgMjM6MzUsIFNhbXVlbCBU
aGliYXVsdCB3cm90ZToNCj4+Pj4+IEp1ZXJnZW4gR3Jvc3MsIGxlIGx1bi4gMjIganVpbC4g
MjAyNCAxNzowMTo0MSArMDIwMCwgYSBlY3JpdDoNCj4+Pj4+PiBSZW1vdmUgdGhlIHNhbml0
eV9jaGVjaygpIGZ1bmN0aW9uLCBhcyBpdCBpcyB1c2VkIG5vd2hlcmUuDQo+Pj4+Pj4NCj4+
Pj4+PiBTaW5jZSBhbnkgYXBwbGljYXRpb24gbGlua2VkIHdpdGggTWluaS1PUyBjYW4ndCBj
YWxsIHNhbml0eV9jaGVjaygpDQo+Pj4+Pj4gZWl0aGVyICh0aGVyZSBpcyBubyBFWFBPUlRf
U1lNQk9MIGZvciBpdCksIHRoZXJlIGlzIHplcm8gY2hhbmNlIG9mDQo+Pj4+Pj4gYnJlYWtp
bmcgYW55IHVzZSBjYXNlLg0KPj4+Pj4NCj4+Pj4+IERvbid0IHdlIHN0aWxsIHdhbnQgdG8g
a2VlcCBpdCBhcm91bmQsIGF0IGxlYXN0IGFzIGZvcm1hbCBkb2N1bWVudGF0aW9uDQo+Pj4+
PiBvZiB0aGUgZXhwZWN0ZWQgc3RhdHVzIG9mIHRoZSBsaXN0Pw0KPj4+Pg0KPj4+PiBIbW0s
IGlzIGl0IHJlYWxseSB3b3J0aCB0aGUgZXh0cmEgY29kZT8NCj4+Pg0KPj4+IEkgaGF2ZSBh
bHJlYWR5IHNlZW4gc3VjaCBraW5kIG9mIHBpZWNlIG9mIGNvZGUgZ2V0dGluZyB2ZXJ5IGNv
bnZlbmllbnQNCj4+PiB3aGVuIHRyYWNraW5nIG9kZCBidWdzLg0KPj4NCj4+IFdoYXQgYWJv
dXQgcHV0dGluZyBpdCB1bmRlciBDT05GSUdfVEVTVCB0aGVuPw0KPiANCj4gT2vCoCENCg0K
SSB3ZW50IGEgbGl0dGxlIGJpdCBmdXJ0aGVyIGJ5IGNhbGxpbmcgc2FuaXR5X2NoZWNrKCkg
ZnJvbSBwZXJpb2RpY190aHJlYWQoKQ0KaW4gdGVzdC5jIG9uY2UgYSBzZWNvbmQuIFRoaXMg
d2lsbCBtYWtlIHJlYWwgdXNlIG9mIHRoZSBmdW5jdGlvbi4NCg0KDQpKdWVyZ2VuDQo=
--------------BKXl3rn22l0PYF1iVOm178o4
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+wsB5BBMBAgAjBQJTjHCvAhsDBwsJ
CAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQsN6d1ii/Ey/HmQf/RtI7kv5A2PS4
RF7HoZhPVPogNVbC4YA6lW7DrWf0teC0RR3MzXfy6pJ+7KLgkqMlrAbN/8Dvjoz7
8X+5vhH/rDLa9BuZQlhFmvcGtCF8eR0T1v0nC/nuAFVGy+67q2DH8As3KPu0344T
BDpAvr2uYM4tSqxK4DURx5INz4ZZ0WNFHcqsfvlGJALDeE0LhITTd9jLzdDad1pQ
SToCnLl6SBJZjDOX9QQcyUigZFtCXFst4dlsvddrxyqT1f17+2cFSdu7+ynLmXBK
7abQ3rwJY8SbRO2iRulogc5vr/RLMMlscDAiDkaFQWLoqHHOdfO9rURssHNN8WkM
nQfvUewRz80hSnVlcmdlbiBHcm9zcyA8amdyb3NzQG5vdmVsbC5jb20+wsB5BBMB
AgAjBQJTjHDXAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQsN6d1ii/
Ey8PUQf/ehmgCI9jB9hlgexLvgOtf7PJnFOXgMLdBQgBlVPO3/D9R8LtF9DBAFPN
hlrsfIG/SqICoRCqUcJ96Pn3P7UUinFG/I0ECGF4EvTE1jnDkfJZr6jrbjgyoZHi
w/4BNwSTL9rWASyLgqlA8u1mf+c2yUwcGhgkRAd1gOwungxcwzwqgljf0N51N5Jf
VRHRtyfwq/ge+YEkDGcTU6Y0sPOuj4Dyfm8fJzdfHNQsWq3PnczLVELStJNdapwP
OoE+lotufe3AM2vAEYJ9rTz3Cki4JFUsgLkHFqGZarrPGi1eyQcXeluldO3m91NK
/1xMI3/+8jbO0tsn1tqSEUGIJi7ox80eSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1
c2UuZGU+wsB5BBMBAgAjBQJTjHDrAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgEC
F4AACgkQsN6d1ii/Ey+LhQf9GL45eU5vOowA2u5N3g3OZUEBmDHVVbqMtzwlmNC4
k9Kx39r5s2vcFl4tXqW7g9/ViXYuiDXb0RfUpZiIUW89siKrkzmQ5dM7wRqzgJpJ
wK8Bn2MIxAKArekWpiCKvBOB/Cc+3EXE78XdlxLyOi/NrmSGRIov0karw2RzMNOu
5D+jLRZQd1Sv27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/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-----

--------------BKXl3rn22l0PYF1iVOm178o4--

--------------96XCosfT8gZudRYgzDFfjsOZ--

--------------7cdd5Knu3JOrgWvNmis168ZQ
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/Ey8FAmah83QFAwAAAAAACgkQsN6d1ii/Ey/v
5gf/Qx6wAjba0UmYYUPL5UgT5CqZmYLphB6cbdnGR4hU2VofE4OLzZnStQSuDyPnNuNqaKrc9/+C
2B5PuyaCwKWrT6HY0g5RNIvKPFPxt3lPoF1w3NTTBW4PqGJIQbJSf0Z1P6XrdVfs5aF9W0MXai61
GhylftN2dKuszQvCQz9/pJU8hRT2DXPpuJ60e9WjvKn3K9gcuLM8yAfQGENFPlu6eTs+JZlsAI2H
4HjYv7WrT01FQtrKSfU0BIV//l+G6FUM0LsA/PpGSXt26cbX27uDeKhasRxIRBegSH+o905ZrP5Y
1pnwy95JusQOoUVvA8ofeu7AHPjh8BblkTzXatx+Og==
=TWi8
-----END PGP SIGNATURE-----

--------------7cdd5Knu3JOrgWvNmis168ZQ--


From minios-devel-bounces@lists.xenproject.org Thu Jul 25 06:42:59 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jul 2024 06:42:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764694.1175192 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWsBn-0002pA-AW; Thu, 25 Jul 2024 06:42:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764694.1175192; Thu, 25 Jul 2024 06:42:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWsBn-0002p3-7j; Thu, 25 Jul 2024 06:42:59 +0000
Received: by outflank-mailman (input) for mailman id 764694;
 Thu, 25 Jul 2024 06:42:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/jnY=OZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sWsBl-0002on-TH
 for minios-devel@lists.xenproject.org; Thu, 25 Jul 2024 06:42:57 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 205d3e64-4a51-11ef-bbff-fd08da9f4363;
 Thu, 25 Jul 2024 08:42:57 +0200 (CEST)
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 6D11321A2C;
 Thu, 25 Jul 2024 06:42: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 3C66B13874;
 Thu, 25 Jul 2024 06:42: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 UkdKDfDzoWavCgAAD6G6ig
 (envelope-from <jgross@suse.com>); Thu, 25 Jul 2024 06:42:56 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 205d3e64-4a51-11ef-bbff-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721889776; 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=Lfts1DgUcPXDbLNnlF8FqwxDF6KaPncxEu7VvAfnPNk=;
	b=axTgCmqnhEwBKV838KWE0dwgd3Tw8sAZgvgGGsUz8mBX6Y9AoRIbhL0aotT5NcNl1uXHk8
	BTchlGV13qLf2Y2vkJxg0YW9NaasnDP6GQX4icfHwERVYlQYwsiYLTmAl3misTVtWWEfha
	xlecHG4yGSUVPlVxf+ITT1Y3y0Ny7Aw=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=axTgCmqn
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1721889776; 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=Lfts1DgUcPXDbLNnlF8FqwxDF6KaPncxEu7VvAfnPNk=;
	b=axTgCmqnhEwBKV838KWE0dwgd3Tw8sAZgvgGGsUz8mBX6Y9AoRIbhL0aotT5NcNl1uXHk8
	BTchlGV13qLf2Y2vkJxg0YW9NaasnDP6GQX4icfHwERVYlQYwsiYLTmAl3misTVtWWEfha
	xlecHG4yGSUVPlVxf+ITT1Y3y0Ny7Aw=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2] mini-os: put sanity_check() under CONFIG_TEST
Date: Thu, 25 Jul 2024 08:42:54 +0200
Message-ID: <20240725064254.7545-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Result: default: False [0.19 / 50.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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	FROM_HAS_DN(0.00)[];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_FIVE(0.00)[5];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spamd-Bar: /
X-Rspamd-Queue-Id: 6D11321A2C
X-Spam-Level: 
X-Rspamd-Action: no action
X-Spam-Flag: NO
X-Spam-Score: 0.19

Hide the sanity_check() function, as it is used nowhere. By putting it
under #ifdef CONFIG_TEST it will stay around, but it won't be
included in normal production builds.

Call sanity_check() from the periodic thread of the test app, causing
a sanity check every second.

Since any application linked with Mini-OS can't call sanity_check()
(there is no EXPORT_SYMBOL for it), there is zero chance of breaking
any use case.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- don't remove it, but just hide it (Samuel Thibault)
---
 include/lib.h | 2 ++
 mm.c          | 2 ++
 test.c        | 1 +
 3 files changed, 5 insertions(+)

diff --git a/include/lib.h b/include/lib.h
index abd4e9ab..de67bab0 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -152,8 +152,10 @@ do {                                                           \
 
 #define BUG_ON(x) ASSERT(!(x))
 
+#ifdef CONFIG_TEST
 /* Consistency check as much as possible. */
 void sanity_check(void);
+#endif
 
 /* Get own domid. */
 domid_t get_domid(void);
diff --git a/mm.c b/mm.c
index 4aa0c6ca..a5d3f5e5 100644
--- a/mm.c
+++ b/mm.c
@@ -395,6 +395,7 @@ void fini_mm(void)
 {
 }
 
+#ifdef CONFIG_TEST
 void sanity_check(void)
 {
     int x;
@@ -410,3 +411,4 @@ void sanity_check(void)
         }
     }
 }
+#endif
diff --git a/test.c b/test.c
index 465c54e8..4dd6e260 100644
--- a/test.c
+++ b/test.c
@@ -185,6 +185,7 @@ static void periodic_thread(void *p)
     {
         gettimeofday(&tv, NULL);
         printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
+        sanity_check();
         msleep(1000);
     }
 }
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Thu Jul 25 06:59:05 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jul 2024 06:59:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.764710.1175207 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sWsRL-0005Ln-NA; Thu, 25 Jul 2024 06:59:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 764710.1175207; Thu, 25 Jul 2024 06: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sWsRL-0005Lg-KA; Thu, 25 Jul 2024 06:59:03 +0000
Received: by outflank-mailman (input) for mailman id 764710;
 Thu, 25 Jul 2024 06:59:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Od1u=OZ=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sWsRK-0005LV-Fp
 for minios-devel@lists.xenproject.org; Thu, 25 Jul 2024 06:59:02 +0000
Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5ed894ae-4a53-11ef-bbff-fd08da9f4363;
 Thu, 25 Jul 2024 08:59:01 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 6F022A02C4;
 Thu, 25 Jul 2024 08:59:00 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 8b8yThK8-v56; Thu, 25 Jul 2024 08:59:00 +0200 (CEST)
Received: from begin (nat-inria-interne-52-gw-01-bso.bordeaux.inria.fr
 [194.199.1.52])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 53DEBA02A2;
 Thu, 25 Jul 2024 08:59:00 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98-RC3)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sWsRI-000000004wm-0H3M; Thu, 25 Jul 2024 08:59:00 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ed894ae-4a53-11ef-bbff-fd08da9f4363
Date: Thu, 25 Jul 2024 08:59:00 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH v2] mini-os: put sanity_check() under CONFIG_TEST
Message-ID: <20240725065859.mp2ijjthuhw7ecgj@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240725064254.7545-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240725064254.7545-1-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le jeu. 25 juil. 2024 08:42:54 +0200, a ecrit:
> Hide the sanity_check() function, as it is used nowhere. By putting it
> under #ifdef CONFIG_TEST it will stay around, but it won't be
> included in normal production builds.
> 
> Call sanity_check() from the periodic thread of the test app, causing
> a sanity check every second.
> 
> Since any application linked with Mini-OS can't call sanity_check()
> (there is no EXPORT_SYMBOL for it), there is zero chance of breaking
> any use case.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Thanks!

> ---
> V2:
> - don't remove it, but just hide it (Samuel Thibault)
> ---
>  include/lib.h | 2 ++
>  mm.c          | 2 ++
>  test.c        | 1 +
>  3 files changed, 5 insertions(+)
> 
> diff --git a/include/lib.h b/include/lib.h
> index abd4e9ab..de67bab0 100644
> --- a/include/lib.h
> +++ b/include/lib.h
> @@ -152,8 +152,10 @@ do {                                                           \
>  
>  #define BUG_ON(x) ASSERT(!(x))
>  
> +#ifdef CONFIG_TEST
>  /* Consistency check as much as possible. */
>  void sanity_check(void);
> +#endif
>  
>  /* Get own domid. */
>  domid_t get_domid(void);
> diff --git a/mm.c b/mm.c
> index 4aa0c6ca..a5d3f5e5 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -395,6 +395,7 @@ void fini_mm(void)
>  {
>  }
>  
> +#ifdef CONFIG_TEST
>  void sanity_check(void)
>  {
>      int x;
> @@ -410,3 +411,4 @@ void sanity_check(void)
>          }
>      }
>  }
> +#endif
> diff --git a/test.c b/test.c
> index 465c54e8..4dd6e260 100644
> --- a/test.c
> +++ b/test.c
> @@ -185,6 +185,7 @@ static void periodic_thread(void *p)
>      {
>          gettimeofday(&tv, NULL);
>          printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
> +        sanity_check();
>          msleep(1000);
>      }
>  }
> -- 
> 2.43.0
> 

-- 
Samuel
`When you say "I wrote a program that crashed Windows", people just stare at
you blankly and say "Hey, I got those with the system, *for free*".'
(By Linus Torvalds)


From minios-devel-bounces@lists.xenproject.org Wed Jul 31 13:00:33 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 13:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.768588.1179440 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wS-0003LH-3E; Wed, 31 Jul 2024 13:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 768588.1179440; Wed, 31 Jul 2024 13: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wS-0003LB-0X; Wed, 31 Jul 2024 13:00:32 +0000
Received: by outflank-mailman (input) for mailman id 768588;
 Wed, 31 Jul 2024 13:00:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q60C=O7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZ8wQ-0003KO-Vt
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 13:00:31 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dcc4e5f0-4f3c-11ef-bc01-fd08da9f4363;
 Wed, 31 Jul 2024 15:00:30 +0200 (CEST)
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 DBC041F833;
 Wed, 31 Jul 2024 13:00:28 +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 9DB0B13297;
 Wed, 31 Jul 2024 13:00: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 y+qaJGw1qmbeWAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 31 Jul 2024 13:00:28 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dcc4e5f0-4f3c-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430828; 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=hpSSf1738sWC9fHR0jGFAPQBcPotnWSurDV4E82jGpw=;
	b=LNR88QzGSLEUWV0lDQUE5eUCmpS/11RQ6N4GenYLFjD4PoLHARip/vjkbaDasmuO/jwEfm
	qB1joTOj6HD3a5jOw/u+o3Q8G92J9xnHLrL0b1hkE3LzA+I7WkfF6yc9iVDBvAhXi3MzZI
	9qO99E9I2pWnV3Oe7aKMjK8TLfStB28=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=LNR88QzG
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430828; 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=hpSSf1738sWC9fHR0jGFAPQBcPotnWSurDV4E82jGpw=;
	b=LNR88QzGSLEUWV0lDQUE5eUCmpS/11RQ6N4GenYLFjD4PoLHARip/vjkbaDasmuO/jwEfm
	qB1joTOj6HD3a5jOw/u+o3Q8G92J9xnHLrL0b1hkE3LzA+I7WkfF6yc9iVDBvAhXi3MzZI
	9qO99E9I2pWnV3Oe7aKMjK8TLfStB28=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 0/3] mini-os: mm: use a generic page table walker
Date: Wed, 31 Jul 2024 15:00:23 +0200
Message-ID: <20240731130026.8467-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Result: default: False [-4.81 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	DWL_DNSWL_MED(-2.00)[suse.com:dkim];
	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];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	FROM_HAS_DN(0.00)[];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	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];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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-Action: no action
X-Spam-Flag: NO
X-Spam-Score: -4.81
X-Rspamd-Queue-Id: DBC041F833

Instead of open coding a page table walk multiple times, use a generic
page table walker instead.

This new page table walker will be used later for kexec support, too.

Juergen Gross (3):
  mini-os: mm: introduce generic page table walk function
  mini-os: mm: switch need_pgt() to use walk_pt()
  mini-os: mm: convert set_readonly() to use walk_pt()

 arch/x86/mm.c | 337 ++++++++++++++++++++++++++++----------------------
 1 file changed, 187 insertions(+), 150 deletions(-)

-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Wed Jul 31 13:00:36 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 13:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.768592.1179458 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wW-0003gI-Es; Wed, 31 Jul 2024 13:00:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 768592.1179458; Wed, 31 Jul 2024 13: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wW-0003gE-Bz; Wed, 31 Jul 2024 13:00:36 +0000
Received: by outflank-mailman (input) for mailman id 768592;
 Wed, 31 Jul 2024 13:00:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q60C=O7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZ8wV-0003KO-NE
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 13:00:35 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de
 [2a07:de40:b251:101:10:150:64:1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e00e31cd-4f3c-11ef-bc01-fd08da9f4363;
 Wed, 31 Jul 2024 15:00:34 +0200 (CEST)
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 7BCA621B69;
 Wed, 31 Jul 2024 13:00: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 49EB613297;
 Wed, 31 Jul 2024 13:00: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 z9SVEHI1qmbmWAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 31 Jul 2024 13:00:34 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e00e31cd-4f3c-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430834; 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=xFjXc7amrrMo+tzrt8XBmjjdTdsuxev2jTdhps3xh1w=;
	b=jB3dnJKbZKbnGEvuYJzIOGjksnvbL5bH40lwZN2/ZQcufdeCpsN7YPb4tsxDnyegrdMRef
	HiOyHmpSphiqH0wzgBTkc2niE3d4Bo9LgtVCiyRnSAq7EOqprBSLFIirzBUKLd6ugYesIY
	aoyM65PcQUam0CyzxIAEJr3iutjkdLI=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430834; 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=xFjXc7amrrMo+tzrt8XBmjjdTdsuxev2jTdhps3xh1w=;
	b=jB3dnJKbZKbnGEvuYJzIOGjksnvbL5bH40lwZN2/ZQcufdeCpsN7YPb4tsxDnyegrdMRef
	HiOyHmpSphiqH0wzgBTkc2niE3d4Bo9LgtVCiyRnSAq7EOqprBSLFIirzBUKLd6ugYesIY
	aoyM65PcQUam0CyzxIAEJr3iutjkdLI=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 1/3] mini-os: mm: introduce generic page table walk function
Date: Wed, 31 Jul 2024 15:00:24 +0200
Message-ID: <20240731130026.8467-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240731130026.8467-1-jgross@suse.com>
References: <20240731130026.8467-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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)[suse.com:email,imap1.dmz-prg2.suse.org:helo];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO
X-Spam-Score: -2.60

In x86 mm code there are multiple instances of page table walks for
different purposes.

Introduce a generic page table walker being able to cover the current
use cases. It will be used for other cases in future, too.

The page table walker needs some per-level data, so add a table for
that data. Merge it with the already existing pt_prot[] array.

Rewrite get_pgt() to use the new walker.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c | 152 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 113 insertions(+), 39 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 7ddf16e4..cc4d41e9 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -125,20 +125,25 @@ void arch_mm_preinit(void *p)
 }
 #endif
 
+static const struct {
+    unsigned int shift;
+    unsigned int entries;
+    pgentry_t prot;
+} ptdata[PAGETABLE_LEVELS + 1] = {
+    { 0, 0, 0 },
+    { L1_PAGETABLE_SHIFT, L1_PAGETABLE_ENTRIES, L1_PROT },
+    { L2_PAGETABLE_SHIFT, L2_PAGETABLE_ENTRIES, L2_PROT },
+    { L3_PAGETABLE_SHIFT, L3_PAGETABLE_ENTRIES, L3_PROT },
+#if defined(__x86_64__)
+    { L4_PAGETABLE_SHIFT, L4_PAGETABLE_ENTRIES, L4_PROT },
+#endif
+};
+
 /*
  * Make pt_pfn a new 'level' page table frame and hook it into the page
  * table at offset in previous level MFN (pref_l_mfn). pt_pfn is a guest
  * PFN.
  */
-static pgentry_t pt_prot[PAGETABLE_LEVELS] = {
-    L1_PROT,
-    L2_PROT,
-    L3_PROT,
-#if defined(__x86_64__)
-    L4_PROT,
-#endif
-};
-
 static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn, 
                          unsigned long offset, unsigned long level)
 {   
@@ -170,7 +175,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
     mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) + 
         sizeof(pgentry_t) * l1_table_offset(pt_page);
     mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | 
-        (pt_prot[level - 1] & ~_PAGE_RW);
+        (ptdata[level].prot & ~_PAGE_RW);
     
     if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 )
     {
@@ -183,7 +188,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
     mmu_updates[0].ptr =
         ((pgentry_t)prev_l_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
     mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT |
-        pt_prot[level];
+        ptdata[level + 1].prot;
 
     if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 ) 
     {
@@ -192,7 +197,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
     }
 #else
     tab = mfn_to_virt(prev_l_mfn);
-    tab[offset] = (*pt_pfn << PAGE_SHIFT) | pt_prot[level];
+    tab[offset] = (*pt_pfn << PAGE_SHIFT) | ptdata[level + 1].prot;
 #endif
 
     *pt_pfn += 1;
@@ -202,6 +207,82 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
 static mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
 #endif
 
+/*
+ * Walk recursively through all PTEs calling a specified function. The function
+ * is allowed to change the PTE, the walker will follow the new value.
+ * The walk will cover the virtual address range [from_va .. to_va].
+ * The supplied function will be called with the following parameters:
+ * va: base virtual address of the area covered by the current PTE
+ * lvl: page table level of the PTE (1 = lowest level, PAGETABLE_LEVELS =
+ *      PTE in page table addressed by %cr3)
+ * is_leaf: true if PTE doesn't address another page table
+ * pte: address of the PTE
+ * par: parameter, passed to walk_pt() by caller
+ * Return value of func() being non-zero will terminate walk_pt(), walk_pt()
+ * will return that value in this case, zero else.
+ */
+static int walk_pt(unsigned long from_va, unsigned long to_va,
+                   int (func)(unsigned long va, unsigned int lvl,
+                              bool is_leaf, pgentry_t *pte, void *par),
+                   void *par)
+{
+    unsigned int lvl = PAGETABLE_LEVELS;
+    unsigned int ptindex[PAGETABLE_LEVELS + 1];
+    unsigned long va = round_pgdown(from_va);
+    unsigned long va_lvl;
+    pgentry_t *tab[PAGETABLE_LEVELS + 1];
+    pgentry_t *pte;
+    bool is_leaf;
+    int ret;
+
+    /* Start at top level page table. */
+    tab[lvl] = pt_base;
+    ptindex[lvl] = (va >> ptdata[lvl].shift) & (ptdata[lvl].entries - 1);
+
+    while ( va < (to_va | (PAGE_SIZE - 1)) )
+    {
+        pte = tab[lvl] + ptindex[lvl];
+        is_leaf = (lvl == L1_FRAME) || (*pte & _PAGE_PSE) ||
+                  !(*pte & _PAGE_PRESENT);
+        va_lvl = va & ~((1UL << ptdata[lvl].shift) - 1);
+        ret = func(va_lvl, lvl, is_leaf, pte, par);
+        if ( ret )
+            return ret;
+
+        /* PTE might have been modified by func(), reevaluate leaf state. */
+        is_leaf = (lvl == L1_FRAME) || (*pte & _PAGE_PSE) ||
+                  !(*pte & _PAGE_PRESENT);
+
+        if ( is_leaf )
+        {
+            /* Reached a leaf PTE. Advance to next page. */
+            va += 1UL << ptdata[lvl].shift;
+            ptindex[lvl]++;
+
+            /* Check for the need to traverse up again. */
+            while ( ptindex[lvl] == ptdata[lvl].entries )
+            {
+                /* End of virtual address space? */
+                if ( lvl == PAGETABLE_LEVELS )
+                    return 0;
+                /* Reached end of current page table, one level up. */
+                lvl++;
+                ptindex[lvl]++;
+            }
+        }
+        else
+        {
+            /* Not a leaf, walk one level down. */
+            lvl--;
+            tab[lvl] = mfn_to_virt(pte_to_mfn(*pte));
+            ptindex[lvl] = (va >> ptdata[lvl].shift) &
+                           (ptdata[lvl].entries - 1);
+        }
+    }
+
+    return 0;
+}
+
 /*
  * Build the initial pagetable.
  */
@@ -407,36 +488,29 @@ static void set_readonly(void *text, void *etext)
 /*
  * get the PTE for virtual address va if it exists. Otherwise NULL.
  */
-static pgentry_t *get_pgt(unsigned long va)
+static int get_pgt_func(unsigned long va, unsigned int lvl, bool is_leaf,
+                        pgentry_t *pte, void *par)
 {
-    unsigned long mfn;
-    pgentry_t *tab;
-    unsigned offset;
+    pgentry_t **result;
 
-    tab = pt_base;
-    mfn = virt_to_mfn(pt_base);
+    if ( !(*pte & _PAGE_PRESENT) && lvl > L1_FRAME )
+        return -1;
 
-#if defined(__x86_64__)
-    offset = l4_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) )
-        return NULL;
-    mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(mfn);
-#endif
-    offset = l3_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) )
-        return NULL;
-    mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(mfn);
-    offset = l2_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) )
-        return NULL;
-    if ( tab[offset] & _PAGE_PSE )
-        return &tab[offset];
-    mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(mfn);
-    offset = l1_table_offset(va);
-    return &tab[offset];
+    if ( lvl > L1_FRAME && !(*pte & _PAGE_PSE) )
+        return 0;
+
+    result = par;
+    *result = pte;
+
+    return 0;
+}
+
+static pgentry_t *get_pgt(unsigned long va)
+{
+    pgentry_t *tab = NULL;
+
+    walk_pt(va, va, get_pgt_func, &tab);
+    return tab;
 }
 
 
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Wed Jul 31 13:00:44 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 13:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.768596.1179482 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8we-0004LZ-03; Wed, 31 Jul 2024 13:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 768596.1179482; Wed, 31 Jul 2024 13: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wd-0004LN-SX; Wed, 31 Jul 2024 13:00:43 +0000
Received: by outflank-mailman (input) for mailman id 768596;
 Wed, 31 Jul 2024 13:00:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q60C=O7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZ8wc-0003KO-4q
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 13:00:42 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e35a8783-4f3c-11ef-bc01-fd08da9f4363;
 Wed, 31 Jul 2024 15:00:40 +0200 (CEST)
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 16A1921B61;
 Wed, 31 Jul 2024 13:00:40 +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 DA8ED13297;
 Wed, 31 Jul 2024 13:00:39 +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 MN3LM3c1qmb5WAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 31 Jul 2024 13:00:39 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e35a8783-4f3c-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430840; 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=YykKbfS2IJgdkLFFy5acGGcdbHS6FrMXXxAPIolzhxo=;
	b=kda6Ht6lVqFoJ4aXkKYbYjrHIHDfJufboK/HmgvGZMikS/y3QTjMtOYt8GD/q2mJ5gCKPz
	Vfqy3lygv1CAqPI7Xx+n3rSw3Bssy4VJHhEmy3zqfxbvMFFRp8G917U5bk+EYMmtwsViCH
	4YQo/5C/eXy43bpjCoOTnyBarwyQ3NM=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430840; 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=YykKbfS2IJgdkLFFy5acGGcdbHS6FrMXXxAPIolzhxo=;
	b=kda6Ht6lVqFoJ4aXkKYbYjrHIHDfJufboK/HmgvGZMikS/y3QTjMtOYt8GD/q2mJ5gCKPz
	Vfqy3lygv1CAqPI7Xx+n3rSw3Bssy4VJHhEmy3zqfxbvMFFRp8G917U5bk+EYMmtwsViCH
	4YQo/5C/eXy43bpjCoOTnyBarwyQ3NM=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Date: Wed, 31 Jul 2024 15:00:25 +0200
Message-ID: <20240731130026.8467-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240731130026.8467-1-jgross@suse.com>
References: <20240731130026.8467-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	ARC_NA(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo]
X-Spam-Flag: NO
X-Spam-Score: -2.60

Instead of open coding a page table walk, use walk_pt() in need_pgt().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c | 66 +++++++++++++++++++--------------------------------
 1 file changed, 24 insertions(+), 42 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index cc4d41e9..accde291 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -518,57 +518,39 @@ static pgentry_t *get_pgt(unsigned long va)
  * return a valid PTE for a given virtual address. If PTE does not exist,
  * allocate page-table pages.
  */
-pgentry_t *need_pgt(unsigned long va)
+static int need_pgt_func(unsigned long va, unsigned int lvl, bool is_leaf,
+                         pgentry_t *pte, void *par)
 {
+    pgentry_t **result = par;
     unsigned long pt_mfn;
-    pgentry_t *tab;
     unsigned long pt_pfn;
-    unsigned offset;
+    unsigned int idx;
 
-    tab = pt_base;
-    pt_mfn = virt_to_mfn(pt_base);
+    if ( !is_leaf )
+        return 0;
 
-#if defined(__x86_64__)
-    offset = l4_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) )
-    {
-        pt_pfn = virt_to_pfn(alloc_page());
-        if ( !pt_pfn )
-            return NULL;
-        new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
-    }
-    ASSERT(tab[offset] & _PAGE_PRESENT);
-    pt_mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(pt_mfn);
-#endif
-    offset = l3_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) ) 
-    {
-        pt_pfn = virt_to_pfn(alloc_page());
-        if ( !pt_pfn )
-            return NULL;
-        new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
-    }
-    ASSERT(tab[offset] & _PAGE_PRESENT);
-    pt_mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(pt_mfn);
-    offset = l2_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) )
+    if ( lvl == L1_FRAME || (*pte & _PAGE_PRESENT) )
     {
-        pt_pfn = virt_to_pfn(alloc_page());
-        if ( !pt_pfn )
-            return NULL;
-        new_pt_frame(&pt_pfn, pt_mfn, offset, L1_FRAME);
+        *result = pte;
+        return 1;
     }
-    ASSERT(tab[offset] & _PAGE_PRESENT);
-    if ( tab[offset] & _PAGE_PSE )
-        return &tab[offset];
 
-    pt_mfn = pte_to_mfn(tab[offset]);
-    tab = mfn_to_virt(pt_mfn);
+    pt_mfn = virt_to_mfn(pte);
+    pt_pfn = virt_to_pfn(alloc_page());
+    if ( !pt_pfn )
+        return -1;
+    idx = (va >> ptdata[lvl].shift) & (ptdata[lvl].entries - 1);
+    new_pt_frame(&pt_pfn, pt_mfn, idx, lvl - 1);
 
-    offset = l1_table_offset(va);
-    return &tab[offset];
+    return 0;
+}
+
+pgentry_t *need_pgt(unsigned long va)
+{
+    pgentry_t *tab = NULL;
+
+    walk_pt(va, va, need_pgt_func, &tab);
+    return tab;
 }
 EXPORT_SYMBOL(need_pgt);
 
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Wed Jul 31 13:00:51 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 13:00:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.768601.1179490 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wl-0004bq-23; Wed, 31 Jul 2024 13:00:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 768601.1179490; Wed, 31 Jul 2024 13:00:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZ8wk-0004bi-VV; Wed, 31 Jul 2024 13:00:50 +0000
Received: by outflank-mailman (input) for mailman id 768601;
 Wed, 31 Jul 2024 13:00:49 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q60C=O7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZ8wj-0003df-AP
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 13:00:49 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e423661e-4f3c-11ef-8776-851b0ebba9a2;
 Wed, 31 Jul 2024 15:00:42 +0200 (CEST)
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 AC44B21B78;
 Wed, 31 Jul 2024 13:00:45 +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 78D3213297;
 Wed, 31 Jul 2024 13:00: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 MBYPHH01qmYAWQAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 31 Jul 2024 13:00:45 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e423661e-4f3c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430845; 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=tSF1mgyyRozqIhqSscGGgmQznHAJUWT1VxHYxdygHx8=;
	b=AHTTS6nCUZ7FhXGl14JRg8q5Vm0NskVBAKF2Soyes8jqrhNIxBqB4rkOO4WDgPt3HRzlH4
	jO5Y6gq+0kY//GsR2cfd6F0IdKzpAcg8UtKzru7NhXdvUTDnAUiYj73i7eUbp8hExOYVEk
	FOECsX7c4KBY/lHS+A8dlA2Ip83QIRU=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722430845; 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=tSF1mgyyRozqIhqSscGGgmQznHAJUWT1VxHYxdygHx8=;
	b=AHTTS6nCUZ7FhXGl14JRg8q5Vm0NskVBAKF2Soyes8jqrhNIxBqB4rkOO4WDgPt3HRzlH4
	jO5Y6gq+0kY//GsR2cfd6F0IdKzpAcg8UtKzru7NhXdvUTDnAUiYj73i7eUbp8hExOYVEk
	FOECsX7c4KBY/lHS+A8dlA2Ip83QIRU=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 3/3] mini-os: mm: convert set_readonly() to use walk_pt()
Date: Wed, 31 Jul 2024 15:00:26 +0200
Message-ID: <20240731130026.8467-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240731130026.8467-1-jgross@suse.com>
References: <20240731130026.8467-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-2.60 / 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)[];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	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)[imap1.dmz-prg2.suse.org:helo,suse.com:email];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Flag: NO
X-Spam-Score: -2.60

Instead of having another copy of a page table walk in set_readonly(),
just use walk_pt().

As it will be needed later anyway, split out the TLB flushing into a
dedicated function.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c | 119 +++++++++++++++++++++-----------------------------
 1 file changed, 50 insertions(+), 69 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index accde291..90992068 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -397,92 +397,73 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
  * Mark portion of the address space read only.
  */
 extern struct shared_info shared_info;
-static void set_readonly(void *text, void *etext)
-{
-    unsigned long start_address =
-        ((unsigned long) text + PAGE_SIZE - 1) & PAGE_MASK;
-    unsigned long end_address = (unsigned long) etext;
-    pgentry_t *tab = pt_base, page;
-    unsigned long mfn = pfn_to_mfn(virt_to_pfn(pt_base));
-    unsigned long offset;
-    unsigned long page_size = PAGE_SIZE;
+
+struct set_readonly_par {
+    unsigned long etext;
 #ifdef CONFIG_PARAVIRT
-    int count = 0;
-    int rc;
+    unsigned int count;
 #endif
+};
 
-    printk("setting %p-%p readonly\n", text, etext);
+static int set_readonly_func(unsigned long va, unsigned int lvl, bool is_leaf,
+                             pgentry_t *pte, void *par)
+{
+    struct set_readonly_par *ro = par;
 
-    while ( start_address + page_size <= end_address )
-    {
-        tab = pt_base;
-        mfn = pfn_to_mfn(virt_to_pfn(pt_base));
+    if ( !is_leaf )
+        return 0;
 
-#if defined(__x86_64__)
-        offset = l4_table_offset(start_address);
-        page = tab[offset];
-        mfn = pte_to_mfn(page);
-        tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
-#endif
-        offset = l3_table_offset(start_address);
-        page = tab[offset];
-        mfn = pte_to_mfn(page);
-        tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
-        offset = l2_table_offset(start_address);        
-        if ( !(tab[offset] & _PAGE_PSE) )
-        {
-            page = tab[offset];
-            mfn = pte_to_mfn(page);
-            tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
+    if ( va + (1UL << ptdata[lvl].shift) > ro->etext )
+        return 1;
 
-            offset = l1_table_offset(start_address);
-        }
+    if ( va == (unsigned long)&shared_info )
+    {
+        printk("skipped %lx\n", va);
+        return 0;
+    }
 
-        if ( start_address != (unsigned long)&shared_info )
-        {
 #ifdef CONFIG_PARAVIRT
-            mmu_updates[count].ptr = 
-                ((pgentry_t)mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
-            mmu_updates[count].val = tab[offset] & ~_PAGE_RW;
-            count++;
+    mmu_updates[ro->count].ptr = virt_to_mach(pte);
+    mmu_updates[ro->count].val = *pte & ~_PAGE_RW;
+    ro->count++;
+
+    if ( (ro->count == L1_PAGETABLE_ENTRIES ||
+          va + 2 * PAGE_SIZE > ro->etext) &&
+         HYPERVISOR_mmu_update(mmu_updates, ro->count, NULL, DOMID_SELF) < 0 )
+    {
+        printk("ERROR: set_readonly(): PTE could not be updated\n");
+        do_exit();
+    }
 #else
-            tab[offset] &= ~_PAGE_RW;
+    *pte &= ~_PAGE_RW;
 #endif
-        }
-        else
-            printk("skipped %lx\n", start_address);
 
-        start_address += page_size;
+    return 0;
+}
 
 #ifdef CONFIG_PARAVIRT
-        if ( count == L1_PAGETABLE_ENTRIES || 
-             start_address + page_size > end_address )
-        {
-            rc = HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF);
-            if ( rc < 0 )
-            {
-                printk("ERROR: set_readonly(): PTE could not be updated\n");
-                do_exit();
-            }
-            count = 0;
-        }
-#else
-        if ( start_address == (1UL << L2_PAGETABLE_SHIFT) )
-            page_size = 1UL << L2_PAGETABLE_SHIFT;
-#endif
-    }
+static void tlb_flush(void)
+{
+    mmuext_op_t op = { .cmd = MMUEXT_TLB_FLUSH_ALL };
+    int count;
 
-#ifdef CONFIG_PARAVIRT
-    {
-        mmuext_op_t op = {
-            .cmd = MMUEXT_TLB_FLUSH_ALL,
-        };
-        int count;
-        HYPERVISOR_mmuext_op(&op, 1, &count, DOMID_SELF);
-    }
+    HYPERVISOR_mmuext_op(&op, 1, &count, DOMID_SELF);
+}
 #else
+static void tlb_flush(void)
+{
     write_cr3((unsigned long)pt_base);
+}
 #endif
+
+static void set_readonly(void *text, void *etext)
+{
+    struct set_readonly_par setro = { .etext = (unsigned long)etext };
+    unsigned long start_address = PAGE_ALIGN((unsigned long)text);
+
+    printk("setting %p-%p readonly\n", text, etext);
+    walk_pt(start_address, setro.etext, set_readonly_func, &setro);
+    tlb_flush();
 }
 
 /*
-- 
2.43.0



From minios-devel-bounces@lists.xenproject.org Wed Jul 31 21:28:00 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 21:28:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769100.1179992 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZGrW-00032P-Ja; Wed, 31 Jul 2024 21:27:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769100.1179992; Wed, 31 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sZGrW-00032F-Ga; Wed, 31 Jul 2024 21:27:58 +0000
Received: by outflank-mailman (input) for mailman id 769100;
 Wed, 31 Jul 2024 21:27:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8eAs=O7=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZGrV-0002nc-Jm
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 21:27:57 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bef3cc30-4f83-11ef-8776-851b0ebba9a2;
 Wed, 31 Jul 2024 23:27:53 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 5335FA02F7;
 Wed, 31 Jul 2024 23:27:53 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 6Iz8zjDtMuoK; Wed, 31 Jul 2024 23:27:53 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 16AB0A02F3;
 Wed, 31 Jul 2024 23:27:53 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZGrQ-0000000AtAZ-2sPc; Wed, 31 Jul 2024 23:27:52 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bef3cc30-4f83-11ef-8776-851b0ebba9a2
Date: Wed, 31 Jul 2024 23:27:52 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Message-ID: <20240731212752.zd5njpd7kgoc433d@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-3-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240731130026.8467-3-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Hello,

Juergen Gross, le mer. 31 juil. 2024 15:00:25 +0200, a ecrit:
> -pgentry_t *need_pgt(unsigned long va)
> +static int need_pgt_func(unsigned long va, unsigned int lvl, bool is_leaf,
> +                         pgentry_t *pte, void *par)
>  {
[...]
> +    if ( lvl == L1_FRAME || (*pte & _PAGE_PRESENT) )

Did you mean (*pte & _PAGE_PSE)?

>      {
> +        *result = pte;
> +        return 1;
>      }

Samuel


From minios-devel-bounces@lists.xenproject.org Wed Jul 31 21:33:17 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 21:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769112.1179998 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZGwe-0004N9-1Q; Wed, 31 Jul 2024 21:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769112.1179998; Wed, 31 Jul 2024 21: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 <minios-devel-bounces@lists.xenproject.org>)
	id 1sZGwd-0004N2-Tc; Wed, 31 Jul 2024 21:33:15 +0000
Received: by outflank-mailman (input) for mailman id 769112;
 Wed, 31 Jul 2024 21:33:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8eAs=O7=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZGwc-0004MN-Q7
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 21:33:14 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7d9b6987-4f84-11ef-bc02-fd08da9f4363;
 Wed, 31 Jul 2024 23:33:13 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 2F66CA02F7;
 Wed, 31 Jul 2024 23:33:13 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id L05rIJDNHBTv; Wed, 31 Jul 2024 23:33:13 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 1106FA02F3;
 Wed, 31 Jul 2024 23:33:13 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZGwa-0000000B7TN-2lLh; Wed, 31 Jul 2024 23:33:12 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7d9b6987-4f84-11ef-bc02-fd08da9f4363
Date: Wed, 31 Jul 2024 23:33:12 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 1/3] mini-os: mm: introduce generic page table walk
 function
Message-ID: <20240731213312.7qztj2qwv7g4if5e@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-2-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240731130026.8467-2-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le mer. 31 juil. 2024 15:00:24 +0200, a ecrit:
> +            ptindex[lvl] = (va >> ptdata[lvl].shift) &
> +                           (ptdata[lvl].entries - 1);

It seems that this kind of va+lvl-to-index computation happens several
times? It's probably worth making it a macro.

Samuel


From minios-devel-bounces@lists.xenproject.org Wed Jul 31 21:38:01 2024
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 21:38:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769124.1180011 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZH1E-0005HO-Ix; Wed, 31 Jul 2024 21:38:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769124.1180011; Wed, 31 Jul 2024 21:38:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1sZH1E-0005HH-Fz; Wed, 31 Jul 2024 21:38:00 +0000
Received: by outflank-mailman (input) for mailman id 769124;
 Wed, 31 Jul 2024 21:37:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8eAs=O7=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZH1C-0005H6-Rs
 for minios-devel@lists.xenproject.org; Wed, 31 Jul 2024 21:37:58 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24e76c74-4f85-11ef-8776-851b0ebba9a2;
 Wed, 31 Jul 2024 23:37:54 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id E80C2A02F7;
 Wed, 31 Jul 2024 23:37:53 +0200 (CEST)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id rg-Yh-7p8FpE; Wed, 31 Jul 2024 23:37:53 +0200 (CEST)
Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr
 [83.192.234.57])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id CC3F4A02F3;
 Wed, 31 Jul 2024 23:37:53 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZH17-0000000BKFG-1iMz; Wed, 31 Jul 2024 23:37:53 +0200
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24e76c74-4f85-11ef-8776-851b0ebba9a2
Date: Wed, 31 Jul 2024 23:37:53 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH 3/3] mini-os: mm: convert set_readonly() to use walk_pt()
Message-ID: <20240731213753.hduimhyf56bf7yr4@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-4-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240731130026.8467-4-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le mer. 31 juil. 2024 15:00:26 +0200, a ecrit:
> +static int set_readonly_func(unsigned long va, unsigned int lvl, bool is_leaf,
> +                             pgentry_t *pte, void *par)
> +{
> +    struct set_readonly_par *ro = par;
>  
> +    mmu_updates[ro->count].ptr = virt_to_mach(pte);
> +    mmu_updates[ro->count].val = *pte & ~_PAGE_RW;
> +    ro->count++;
> +
> +    if ( (ro->count == L1_PAGETABLE_ENTRIES ||
> +          va + 2 * PAGE_SIZE > ro->etext) &&
> +         HYPERVISOR_mmu_update(mmu_updates, ro->count, NULL, DOMID_SELF) < 0 )
> +    {
> +        printk("ERROR: set_readonly(): PTE could not be updated\n");
> +        do_exit();
> +    }

Don't we also want to set ro->count to 0?
And assert that it is 0 after calling walk_pt in set_readonly, to make
sure the va + 2 * PAGE_SIZE > ro->etext test did work properly
(personally I would have rather made set_readonly call a last
HYPERVISOR_mmu_update in case ro->count is not 0, which looks more
robust that a quite magic-looking va + 2 * PAGE_SIZE > ro->etext test)

Samuel


